Skip to main content

parse_document

Function parse_document 

Source
pub fn parse_document(
    doc_id: &str,
    path: &str,
    source: &str,
    minter: &mut dyn Minter,
) -> MutDoc
Expand description

A whole file as a working tree (spec/mutate §11.3, mutate 3.0): the document a create effect adopts into the planner. Parsed verbatim — the leading trivia, the frontmatter block (fences + its trivia) as frontmatter_raw, every body block with the trivia the parser attached, so render reproduces source byte for byte (the round-trip law) — with an id minted per block in pre-order (under the symbolic minter these are the $new.<n> a later effect may name).