Documentation
¶
Overview ¶
Package mdrender renders markdown to terminal-styled output using the shared entire CLI palette (orange H1, cyan H2, indigo H3, plus chroma syntax highlighting). Used by `entire dispatch`, `entire review`, and any other command that prints LLM-generated markdown to the terminal.
Two entry points:
- Render: pure function — caller supplies width and background hint.
- RenderForWriter: TTY-aware — renders to a terminal writer with auto-detected width; passes raw markdown through when w is not a terminal (so redirected output is grep-friendly, not full of ANSI).
Index ¶
Constants ¶
const DefaultTerminalWidth = 80
DefaultTerminalWidth caps glamour word-wrap when no real terminal width is available. Matches the cap used by status_style.getTerminalWidth.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
Render produces a glamour-styled string from markdown using the entire CLI palette. width is the word-wrap target; darkBackground selects the dark or light palette variant.
Errors only on glamour renderer construction or render failure — both of which indicate a malformed StyleConfig (programmer error) rather than a runtime condition. Renderer panics are recovered and returned as errors so callers can fall back to raw markdown instead of crashing.
func RenderForWriter ¶
RenderForWriter renders markdown when w is a terminal writer, and returns the input unchanged otherwise. NO_COLOR=1 also disables rendering so pipelines that grep through redirected output work without unwrapping ANSI escape sequences.
Width is auto-detected from w (capped at 80); background palette is detected via termenv.HasDarkBackground.
Types ¶
This section is empty.