Expand description
Markdown rendering adapters.
§Two output paths
to_ratatui_text— builds aratatui::text::Text<'static>viatui-markdown. Paired with the TUI browser’s right-hand pane.to_html_fragment/to_html_document— renders the same markdown body as minimal HTML for the embedded server’s response. Built onpulldown-cmarkdirectly.
The in-house extras layer (tables, links rendered as underlined
Spans, image-as-stub) lives here; tui-markdown handles the
rest.
Functions§
- resolve_
link - Resolve a relative link inside the doc tree against
root, going through a lexicalsafe_joincheck so../../etc/passwdis rejected before hitting the asset layer. - text_
into_ owned - Deep-clone
textso every span owns its string data. Used by the browser to cache the rendered body across event-loop ticks. - to_
html_ document - Render
bodyas a full HTML document with a minimal stylesheet. Used bycrate::DocsServerto emit the right response forGET /<page>.html. - to_
html_ fragment - Render
bodyas a minimal HTML fragment (no surrounding<html>/<head>). Callers wrap in a full document. - to_
plain_ text - Strip markdown formatting and return a plain-text approximation
of the body. Used for the
tantivyfull-text index. - to_
ratatui_ text - Render
bodyinto aratatui::text::Textsuitable for display inside aParagraphwidget. Delegates the paragraph / emphasis / code-fence path totui-markdown.