Documentation
¶
Index ¶
- func InitWriter(ioCtx io.Context)
- func Markdown(content string) error
- func Markdownf(format string, a ...interface{}) error
- func SetMarkdownRenderer(renderer MarkdownRenderer)
- func Write(content string) error
- func WriteJSON(v interface{}) error
- func WriteYAML(v interface{}) error
- func Writef(format string, a ...interface{}) error
- func Writeln(content string) error
- type MarkdownRenderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitWriter ¶
InitWriter initializes the global data writer with an I/O context. This should be called once at application startup (in root.go).
func Markdown ¶
Markdown renders markdown content and writes to the data channel (stdout). Use this for help text, documentation, and other pipeable formatted content. Flow: data.Markdown() → MarkdownRenderer.Markdown() → io.Write(DataStream) → masking → stdout.
func Markdownf ¶
Markdownf renders formatted markdown content and writes to the data channel (stdout). Flow: data.Markdownf() → data.Markdown() → io.Write(DataStream) → masking → stdout.
func SetMarkdownRenderer ¶
func SetMarkdownRenderer(renderer MarkdownRenderer)
SetMarkdownRenderer sets the markdown renderer for data.Markdown(). This should be called after ui.InitFormatter() in root.go.
func Write ¶
Write writes content to the data channel (stdout). Flow: data.Write() → io.Write(DataStream) → masking → stdout.
func WriteJSON ¶
func WriteJSON(v interface{}) error
WriteJSON marshals v to JSON and writes to the data channel (stdout). Flow: data.WriteJSON() → io.Write(DataStream) → masking → stdout.
func WriteYAML ¶
func WriteYAML(v interface{}) error
WriteYAML marshals v to YAML and writes to the data channel (stdout). Flow: data.WriteYAML() → io.Write(DataStream) → masking → stdout.
Types ¶
type MarkdownRenderer ¶
MarkdownRenderer is the interface for rendering markdown. This avoids circular dependency with pkg/ui.