Documentation
¶
Index ¶
- Constants
- func Arrow(message string)
- func Arrowf(format string, args ...any)
- func Banner(message string)
- func Bold(message string)
- func Boldln(message string)
- func Box(message string)
- func Bullet(message string)
- func Bulletf(format string, args ...any)
- func Clear()
- func Color(message string, color string)
- func ColoredBox(message string, color string)
- func ColoredBullet(message string, color string)
- func ColoredIndent(level int, message string, color string)
- func ColoredList(index int, message string, color string)
- func Colorf(color string, format string, args ...any)
- func Colorln(message string, color string)
- func Debug(message string)
- func Debugf(format string, args ...any)
- func Done(message string)
- func Donef(format string, args ...any)
- func Error(message string)
- func Errorf(format string, args ...any)
- func Field(key, value string)
- func Fieldf(key, format string, args ...any)
- func Header(message string)
- func Headerf(format string, args ...any)
- func Highlight(message string, fgColor, bgColor string)
- func Indent(level int, message string)
- func Indentf(level int, format string, args ...any)
- func Info(message string)
- func Infof(format string, args ...any)
- func Italic(message string)
- func Italicln(message string)
- func KeyValue(key, value string)
- func KeyValuef(key, format string, args ...any)
- func List(index int, message string)
- func Listf(index int, format string, args ...any)
- func Markdown(content string)
- func MarkdownChunk(parser *MarkdownChunkParser, chunk string)
- func NewLine(count ...int)
- func ObjectEnd()
- func ObjectStart(name string)
- func Print(message string)
- func Printf(format string, args ...any)
- func Println(message string)
- func Progress(message string)
- func Progressf(format string, args ...any)
- func Separator()
- func SeparatorWithChar(char string, length int)
- func Step(current, total int, message string)
- func Stepf(current, total int, format string, args ...any)
- func Styled(message string, styles ...string)
- func Styledf(format string, styles []string, args ...any)
- func Styledln(message string, styles ...string)
- func Subheader(message string)
- func Subheaderf(format string, args ...any)
- func Success(message string)
- func Successf(format string, args ...any)
- func Table(key, value string)
- func Tablef(key string, format string, args ...any)
- func Title(message string)
- func Titlef(format string, args ...any)
- func Underline(message string)
- func Underlineln(message string)
- func Warning(message string)
- func Warningf(format string, args ...any)
- type MarkdownChunkParser
- type MessageType
Constants ¶
const ( // Reset and modifiers ColorReset = "\033[0m" ColorBold = "\033[1m" ColorDim = "\033[2m" ColorItalic = "\033[3m" ColorUnderline = "\033[4m" ColorBlink = "\033[5m" ColorReverse = "\033[7m" ColorHidden = "\033[8m" // Standard colors ColorBlack = "\033[30m" ColorRed = "\033[31m" ColorGreen = "\033[32m" ColorYellow = "\033[33m" ColorBlue = "\033[34m" ColorMagenta = "\033[35m" ColorPurple = "\033[35m" // Alias for Magenta ColorCyan = "\033[36m" ColorWhite = "\033[37m" ColorGray = "\033[90m" // Bright colors ColorBrightBlack = "\033[90m" ColorBrightRed = "\033[91m" ColorBrightGreen = "\033[92m" ColorBrightYellow = "\033[93m" ColorBrightBlue = "\033[94m" ColorBrightMagenta = "\033[95m" ColorBrightPurple = "\033[95m" // Alias for Bright Magenta ColorBrightCyan = "\033[96m" ColorBrightWhite = "\033[97m" // Background colors BgBlack = "\033[40m" BgRed = "\033[41m" BgGreen = "\033[42m" BgYellow = "\033[43m" BgBlue = "\033[44m" BgMagenta = "\033[45m" BgCyan = "\033[46m" BgWhite = "\033[47m" // Bright background colors BgBrightBlack = "\033[100m" BgBrightRed = "\033[101m" BgBrightGreen = "\033[102m" BgBrightYellow = "\033[103m" BgBrightBlue = "\033[104m" BgBrightMagenta = "\033[105m" BgBrightCyan = "\033[106m" BgBrightWhite = "\033[107m" )
Color codes for terminal output (same as spinner and prompt packages)
const ( SymbolSuccess = "✓" SymbolError = "✗" SymbolWarning = "⚠" SymbolInfo = "ℹ" SymbolDebug = "●" SymbolArrow = "→" SymbolBullet = "•" SymbolCheck = "✓" SymbolCross = "✗" SymbolStar = "★" SymbolHeart = "♥" SymbolDiamond = "◆" )
Common symbols
Variables ¶
This section is empty.
Functions ¶
func ColoredBox ¶
ColoredBox prints a colored message in a box
func ColoredBullet ¶
ColoredBullet prints a colored bulleted item
func ColoredIndent ¶
ColoredIndent prints a colored indented message
func ColoredList ¶
ColoredList prints a colored numbered list item
func Markdown ¶ added in v0.0.1
func Markdown(content string)
Markdown renders and prints formatted markdown content with colors
func MarkdownChunk ¶ added in v0.0.1
func MarkdownChunk(parser *MarkdownChunkParser, chunk string)
MarkdownChunk processes and displays a chunk of markdown text with streaming support
func ObjectStart ¶
func ObjectStart(name string)
ObjectStart prints the start of an object-like structure
func SeparatorWithChar ¶
SeparatorWithChar prints a separator with a custom character
func Subheaderf ¶
Subheaderf prints a formatted subheader message
func Underlineln ¶
func Underlineln(message string)
Underlineln prints an underlined message with newline
Types ¶
type MarkdownChunkParser ¶ added in v0.0.1
type MarkdownChunkParser struct {
// contains filtered or unexported fields
}
MarkdownChunkParser holds state for streaming markdown parsing
func NewMarkdownChunkParser ¶ added in v0.0.1
func NewMarkdownChunkParser() *MarkdownChunkParser
NewMarkdownChunkParser creates a new streaming markdown parser
func (*MarkdownChunkParser) Flush ¶ added in v0.0.1
func (p *MarkdownChunkParser) Flush()
Flush processes any remaining buffered content
func (*MarkdownChunkParser) Reset ¶ added in v0.0.1
func (p *MarkdownChunkParser) Reset()
Reset resets the parser state
type MessageType ¶
type MessageType int
Message types
const ( MessagePlain MessageType = iota MessageSuccess MessageError MessageWarning MessageInfo MessageDebug )