Skip to main content

Crate markplus_core

Crate markplus_core 

Source
Expand description

§markplus_core

Universal Markdown → AST (JSON) compiler for the MarkPlus ecosystem.

§What this crate does

Parses a Markdown document (with optional YAML frontmatter) into a structured, versioned JSON AST. It does not render HTML or Typst — that is the responsibility of a downstream renderer that consumes the AST.

§Output shape

{
  "schema": 1,
  "meta": { "title": "...", "tags": ["..."] },
  "ast": [
    { "t": "heading", "level": 1, "children": [{ "t": "text", "text": "Hi" }] },
    { "t": "fenced", "name": "mermaid", "attrs": {}, "raw": "graph TD\nA-->B" }
  ]
}

Modules§

ast
Stack-based Markdown AST builder.
config
Parser configuration and pulldown-cmark option flags.
docs
Comprehensive guides and references.
event_filter
Frontmatter extraction layer.
json
Wire format for the compiled site asset (note_XXX.json).

Enums§

CompileError
Errors that can occur while compiling Markdown into a SiteAsset.

Functions§

parse_body
Parse a pre-stripped Markdown body (no frontmatter) into an AST array.
parse_document
Parse a raw .md source (may contain YAML frontmatter) into a SiteAsset containing parsed metadata and the full MarkPlus AST.
strip_frontmatter
Return the Markdown body with a leading YAML frontmatter block removed.