Skip to main content

Module markdown

Module markdown 

Source
Expand description

A purpose-built markdown → styled-lines renderer for the document pane.

Not a general CommonMark engine: OKF bodies are deliberately simple, and okf-core already ships the hard parts (heading extraction, link parsing, footnote scanning). The renderer’s extra job over plain text is the link focus map: every rendered link and footnote reference records its line so the viewer can Tab-cycle and Enter-follow them.

Structs§

FocusTarget
One focusable element and the rendered line it starts on.
HeadingPos
A heading’s position in the rendered output.
RenderedDoc
The rendered document: styled lines plus the focus and jump maps.

Enums§

FocusKind
What a focusable element in the rendered document points at.

Functions§

char_width
Display width of a char: a small wcwidth approximation on std.
render_document
Renders a document body at a pane width.
str_width
Display width of a string.
truncate_to_width
Truncates s to at most max display columns, appending when cut.