Documentation
¶
Overview ¶
Package mdtext converts light Markdown into the two forms OpenPanda's surfaces need beyond a rendered web page:
- Plain: readable prose for TTS (the voice pipeline) and for pipes / logs — emphasis markers, link syntax and fence markers are dropped, table rows become comma-separated values.
- ANSI: a terminal-friendly render for TTYs — headings become bold cyan, bold/italic/code keep their emphasis via SGR, tables stay column-aligned.
It is a small line-oriented state machine, not a full Markdown parser: model answers are light Markdown (headings, lists, tables, fenced code, emphasis), and the goal is that nothing reads worse than it would as raw text. A gofmt-style fenced block passes through untouched (plain) or dim (ANSI); anything unrecognized is kept verbatim.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ANSI ¶
ANSI renders Markdown with SGR emphasis for color TTYs: headings bold cyan, fenced code dim, bold→bold, code→dim, italic→italic, tables column-aligned, lists and quotes kept. When the caller already knows the sink is not a TTY it should use Plain instead.
func IsFenceStart ¶
IsFenceStart reports whether a line opens or closes a fenced code block (``` markers); streaming line renderers track fence state with this and pass lines through untouched inside a fence.
func LineANSI ¶
LineANSI renders one Markdown line with SGR emphasis (see ANSI). fence selects code-block pass-through. It is stateless so a stream can render line by line as deltas arrive.
Types ¶
This section is empty.