Skip to main content

to_markdown

Function to_markdown 

Source
pub fn to_markdown(blocks: &[Block]) -> String
Expand description

Every block as markdown, blocks separated by a blank line.

Preview: output quality is still improving and the API may change in a minor release.

Headings become #..###, list items - and 1., a table a pipe table or an HTML one, a page change a comment, and the furniture nothing at all. to_markdown_with_options is the same serialisation with the switches: furniture as plain paragraphs, and no page marker at all. Monospace runs become code, as ExtractOptions::code says by default (see to_markdown_with_code for the switch).

Deterministic: the same blocks produce the same bytes, which is what makes a golden test over it possible at all (#572).