common

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YAMLFormat = "yaml"

	JSONFormat = "json"
)
View Source
const HeaderContextKey = "ctx"

Variables

This section is empty.

Functions

func ColorizeTags

func ColorizeTags(tags []string) string

ColorizeTags sorts tags and renders each as a colored pill badge.

func CopyToClipboard

func CopyToClipboard(container *tuikit.Container, text, successMsg string)

CopyToClipboard writes text to the system clipboard in a goroutine to avoid blocking the bubbletea event loop (pbcopy/xclip can hang under raw terminal mode). Shows a toast notice on success or failure.

func NormalizeFormat

func NormalizeFormat(format string) string

func OpenInEditor

func OpenInEditor(path string, stdIn, stdOut *os.File) error

func ShortenPath

func ShortenPath(p string) string

ShortenPath returns a display-friendly version of p: the home directory prefix is replaced with ~/, and if the result still has more than maxPathSegments slash-separated components the last four are kept preceded by …/.

func TagColor

func TagColor(tag string) color.Color

TagColor derives a deterministic color from the tag text using FNV hashing mapped to the HSL hue wheel with fixed saturation/lightness.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL