markdown

Markdown-to-styled-terminal renderer. Markdown-to-styled-terminal renderer.

Two-pass pipeline: parse converts markdown into a typed Block IR, then [render] walks that IR to produce styled terminal output. The IR split keeps each pass small and independently testable.

Name Summary
block Intermediate representation for parsed markdown.
parse Parse pass: convert pulldown-cmark events into the Block IR.
render Render pass: convert the Block IR into styled terminal output.

fn render

source

pub fn render(input: &str, width: usize) -> String

Render a markdown string to styled terminal output, fitted to width columns.

Parameter Type Description
input &str the markdown source, parsed with every pulldown-cmark extension enabled
width usize the column budget for wrapping; 0 turns wrapping off
returns String The styled text, with ANSI escapes when color is enabled.