Documentation
¶
Overview ¶
Package style renders devrig's terminal output: colors, glyphs, and boxes that degrade gracefully. Color is used only on a capable TTY (respecting NO_COLOR / FORCE_COLOR / TERM=dumb, and enabling VT processing on Windows), and Unicode box/▮ glyphs fall back to ASCII where they may not render.
Index ¶
- func Blue(s string) string
- func Bold(s string) string
- func BoldCyan(s string) string
- func BoldMagenta(s string) string
- func Box(title string, rows []string) string
- func ColorEnabled() bool
- func Cyan(s string) string
- func Dim(s string) string
- func Gray(s string) string
- func Green(s string) string
- func Link(url string) string
- func Magenta(s string) string
- func PadRight(s string, n int) string
- func Red(s string) string
- func Width(s string) int
- func Yellow(s string) string
- type Glyphs
- type Spinner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoldMagenta ¶
func Box ¶
Box renders rows inside a rounded, titled border, indented two spaces. Rows may contain color escapes; widths are measured visibly so borders align. Falls back to ASCII corners when Unicode is unavailable.
func Link ¶
Link renders a URL, using an OSC 8 hyperlink on capable terminals so it's clickable, and underlined cyan otherwise.
Types ¶
type Glyphs ¶
type Glyphs struct {
TopLeft, TopRight, BotLeft, BotRight, H, V string
Bullet, MidDot, Arrow string
Running, Pending, Failed, Stopped, Check string
}
Glyphs is the active glyph set (Unicode or ASCII fallback).
type Spinner ¶ added in v0.36.0
type Spinner struct {
// contains filtered or unexported fields
}
Spinner shows an animated "working…" indicator for a long step. It animates in place (carriage return) only on a color-capable TTY; otherwise it prints a single static line at start so piped/CI output stays clean. Stop with Done / Fail to replace the line with a final ✓/✗.
func NewSpinner ¶ added in v0.36.0
NewSpinner creates a spinner with the given label (no trailing punctuation).
func (*Spinner) Done ¶ added in v0.36.0
Done replaces the spinner with a green check and msg (defaults to the label).