Skip to main content

Module doc_render

Module doc_render 

Source
Expand description

doc_render submodule. Render raw hover-doc markdown (from lsp::doc_text_for) into a terminal display string. Same visual surface as the stryke docs interactive browser — bold topic heading, dim rule, cyan inline backticks, green code fences — but without the pager chrome (header/footer banner, page navigation hints), so a single doc page can be returned by the docs(TOPIC) builtin and printed inline at the REPL.

Colors are conditional: callers pass colored=true only when stdout is a TTY so piped / file-redirected output stays clean.

Functions§

render_doc
Render a doc page (heading + rule + body) for terminal display. text is the raw markdown returned by lsp::doc_text_for. When colored is false, ANSI sequences are stripped to empty strings so the output is plain UTF-8 suitable for files / pipes / non-tty sinks.