Expand description
The language-neutral MDI 2.0 syntax core.
Rust is the sole executable syntax authority for an MDI document. It parses CommonMark, GFM, YAML front matter, and MDI into one portable wire tree; language bindings only adapt that tree to their host APIs.
Structs§
- Diagnostic
- A recoverable parser message returned as part of the stable wire contract.
- Document
- The complete language-neutral document tree.
childrenuses mdast’s stable tagged JSON shape (with MDI nodes injected by this crate); every source-backed node is annotated with a UTF-8 bytespan. - Frontmatter
- Ordered YAML front matter, retaining both recognized and unknown fields.
- Frontmatter
Entry - MdiSyntax
Document - Transitional MDI-only document used by the compatibility helper
parse_mdi_syntax. New callers must useparse_document. - Parse
Output - A binding-friendly parse envelope.
- Parser
Capabilities - Parser features represented in a
ParseOutput. - PdfOptions
- Native configuration for Chromium PDF layout. WebAssembly deliberately cannot expose this operation because it cannot launch a local process.
- Source
Span - Half-open UTF-8 byte range in the original source.
Enums§
- Diagnostic
Severity - Severity of a parser diagnostic.
- Inline
- A language-neutral MDI inline AST.
- MdiBlock
- A block-level MDI construct or ordinary source line in the compatibility helper.
- Pagebreak
Variant - A page-break side.
- Ruby
Reading - The reading attached to a ruby base.
- Text
Format - Text export conventions supported by the portable core.
Constants§
- MDI_
IR_ VERSION - Version of the language-neutral wire format returned by the bindings.
- MDI_
SPEC_ VERSION - MDI syntax version implemented by this crate.
- MDI_
STYLESHEET - The base stylesheet is intentionally shipped by the core alongside the semantic HTML. Hosts may add presentation CSS, but not reinterpret nodes.
Functions§
- find_
chromium - Locate common native Chromium installations. Production callers should
prefer the explicit
PdfOptions.chromium_pathfor deterministic deploys. - parse_
document - Parse a complete
.mdidocument. CommonMark and all GFM constructs are parsed bymarkdown-rs; MDI is then lowered into the same tagged tree in Rust. The host never tokenizes Markdown or MDI. - parse_
inlines - Parse MDI inline syntax while keeping all other text literal.
- parse_
json - Serialize
parse_outputfor FFI boundaries. - parse_
mdi_ syntax - Parse only MDI syntax for legacy callers. This is intentionally not the
public whole-document entry point; use
parse_documentinstead. - parse_
output - Parse the complete CommonMark, GFM, front-matter, and MDI document and return the versioned wire envelope used by language bindings.
- render_
docx - Build a baseline DOCX archive directly from Rust IR. It deliberately uses WordprocessingML rather than a host document library, so source syntax and document meaning remain inside the core.
- render_
docx_ document - Build a baseline DOCX archive from a parsed document.
- render_
epub - Build a reflowable EPUB 3 archive entirely from Rust’s document IR. Metadata comes from front matter; richer cover and print-profile options are intentionally layered on this deterministic core API later.
- render_
epub_ document - Build a reflowable EPUB 3 archive from a parsed document.
- render_
html - Render a complete source document to a standalone HTML document directly from the Rust-owned IR. This is intentionally source-oriented for FFI: bindings pass UTF-8 source once and never reconstruct MDI syntax in a host renderer.
- render_
html_ document - Render a previously parsed document to standalone HTML.
- render_
pdf - Render PDF by asking a locally installed Chromium-compatible browser to lay out Rust-generated HTML. Chromium never receives MDI source.
- render_
text - Render source to deterministic plain text from the Rust IR. Typography annotations are represented by their readable base text; page and blank paragraph boundaries remain visible as newlines.
- render_
text_ document - Render a parsed document to plain text.
- render_
text_ format - Render a publication-platform text variant from Rust IR.
indent_prefixis supplied by the host’s already-resolved export profile. - serialize_
mdi - Parse and serialize source to canonical MDI/Markdown spelling in Rust.
- serialize_
mdi_ document - Serialize a parsed document without invoking a host Markdown serializer.