module

Smith::UI::Markdown

A deliberately small markdown renderer — enough of CommonMark that model output reads well, without pulling in a parser dependency. Streaming passes text that ends mid-token, so everything here is per-line and tolerant of an unfinished final line.

Instance methods

inline(text : String, base : Style = Style::NONE) : StyledLine

Inline formatting: bold, italic, code, ~~strike~~ and links. Deliberately simple; nesting is not supported.

Source
render(text : String, width : Int32, color : Bool = true) : Array(StyledLine)

Renders the given markdown into styled lines, wrapped to width.

Source