Documentation
¶
Index ¶
- Constants
- func Colorize(color, text string) string
- func Debug(format string, a ...any)
- func DebugBytes(lang string, b []byte)
- func Error(format string, a ...any)
- func Fatal(format string, a ...any)
- func FillParagraph(text string, maxWidth int) string
- func GetColorEnabled() bool
- func GetOutputMode() string
- func GetShowTimestamp() bool
- func GetVerbose() bool
- func Info(format string, a ...any)
- func IsVerbose() bool
- func JSONMarshal(v any) ([]byte, error)
- func NewTabwrt() *tabwrt
- func Notice(format string, a ...any)
- func Print(a ...any) (n int, err error)
- func PrintBullet(text string)
- func PrintClimeinContent(ctx context.Context, content string)
- func PrintContent(ctx context.Context, reasoning, content string)
- func PrintHeader(title string)
- func PrintJSON(data any) error
- func PrintKeyValue(key, value string)
- func PrintSection(title string)
- func PrintSubSection(title string)
- func PrintUserContent(ctx context.Context, content string)
- func Printf(format string, a ...any) (n int, err error)
- func Println(a ...any) (n int, err error)
- func SetColorEnabled(enabled bool)
- func SetErrorWriter(w io.Writer)
- func SetOutputMode(mode string)
- func SetOutputWriter(w io.Writer)
- func SetShowTimestamp(show bool)
- func SetVerbose(verbose bool)
- func StartWaiting(duration time.Duration) func()
- func Success(format string, a ...any)
- func Warn(format string, a ...any)
- type LogLevel
- type MarkdownToOrgConverter
- type ProgressBar
- type Spinner
- type WaitingManager
Constants ¶
const ( ColorReset = "\033[0m" ColorRed = "\033[31m" ColorGreen = "\033[32m" ColorYellow = "\033[33m" ColorBlue = "\033[34m" ColorPurple = "\033[35m" ColorCyan = "\033[36m" ColorWhite = "\033[37m" ColorGray = "\033[90m" // 粗体颜色 ColorBoldRed = "\033[1;31m" ColorBoldGreen = "\033[1;32m" ColorBoldYellow = "\033[1;33m" ColorBoldBlue = "\033[1;34m" ColorBoldPurple = "\033[1;35m" ColorBoldCyan = "\033[1;36m" ColorBoldWhite = "\033[1;37m" )
Color 定义颜色常量
const DefaultFillWidth = 80
DefaultFillWidth is the default maximum line width for FillParagraph.
Variables ¶
This section is empty.
Functions ¶
func FillParagraph ¶ added in v0.7.5
FillParagraph wraps text at word boundaries to fit within maxWidth characters. It preserves double-newline paragraph breaks and normalizes single newlines to spaces within a paragraph. This is designed for English text; Chinese support will be added later.
If maxWidth <= 0, DefaultFillWidth is used.
func NewTabwrt ¶
func NewTabwrt() *tabwrt
func PrintClimeinContent ¶ added in v0.7.8
Types ¶
type MarkdownToOrgConverter ¶
type MarkdownToOrgConverter struct {
// contains filtered or unexported fields
}
MarkdownToOrgConverter converts Markdown to Org mode
func NewMarkdownToOrgConverter ¶
func NewMarkdownToOrgConverter() *MarkdownToOrgConverter
NewMarkdownToOrgConverter creates a new converter
func (*MarkdownToOrgConverter) ConvertLine ¶
func (c *MarkdownToOrgConverter) ConvertLine(line string) string
ConvertLine converts a single line of Markdown to Org mode
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar 进度条结构
func (*ProgressBar) SetShowValue ¶
func (pb *ProgressBar) SetShowValue(show bool)
SetShowValue 设置是否显示数值
type WaitingManager ¶
type WaitingManager struct {
// contains filtered or unexported fields
}
WaitingManager 等待动画管理器
func (*WaitingManager) RecordOutput ¶
func (w *WaitingManager) RecordOutput()
RecordOutput 记录输出事件,重置等待计时器
func (*WaitingManager) StartWaiting ¶
func (w *WaitingManager) StartWaiting(delay time.Duration)
StartWaiting 开始等待监控 如果 delay 秒内没有输出,则启动等待动画
Source Files
¶
- emacs_waiting.go
- fill.go
- markdown2org.go
- output.go
- tabwrt.go
- waiting_animation.go