Widgets / Markdown

Markdown

Renders headings, lists, code, quotes, and OSC 8 links to a node.

MarkdownHeadingA paragraph with bold, italic, and code. • first bullet • second bullet │ a block quote

Signature

Markdown.render (style: MarkdownStyle) (width: int) (src: string) : LayoutNode<'msg>
Markdown.wrap (style: MarkdownStyle) (width: int) (baseStyle: Style) (text: string) : LayoutNode<'msg>

Parameters

parameter type what it is
style MarkdownStyle Heading / code / link styling. Use theme.markdown.
width int Wrap width, in cells.
src string The markdown source.

Notes

Renders a useful subset — headings, lists, code, block quotes, and links — to a layout node. Links carry their real URL as an OSC 8 hyperlink, clickable in terminals that support it.

Example

Markdown.render theme.markdown 60
    "# Done\n\nBuilt **2 targets** in `1.1s`."