HTML / TXT / EPUB / DOCX / PDF outputs
Prerequisites: Rendering model and the Chromium/PDF boundary.
Every output below is a transformation of the same MDI document IR (see Document IR) — none of them is a second syntax layer, and none of them re-decides what a piece of source text means. This page is the package-boundary view; Rendering model is the renderer-internals view of the same five outputs.
| Format | Package | What it actually is |
|---|---|---|
| HTML | @illusions-lab/mdi (renderHtml) | A standalone HTML document plus the embedded .mdi-* stylesheet |
| TXT (6 flavors) | @illusions-lab/mdi (renderTextFormat) / CLI | Plain, ruby-preserving, or a specific Japanese publishing platform’s plain-text convention — including note export |
| EPUB | @illusions-lab/mdi (renderEpub) | A real EPUB 3 archive: reflowable XHTML chapters + nav.xhtml + CSS + OPF package, zipped by Rust |
| DOCX | @illusions-lab/mdi (renderDocx) | A real OOXML (WordprocessingML) document, zipped by Rust |
@illusions-lab/mdi-to-pdf | Rust-rendered HTML/print CSS, laid out and rasterized by a locally installed Chromium-family browser |
Four of these five are produced entirely inside Rust, including profile-configured EPUB and DOCX. The CLI and JavaScript package call straight into mdi-core; their JavaScript layers normalize arguments but do not render documents. PDF uses Rust-resolved profile data and Rust-prepared HTML/print CSS, then asks a native or Node host to launch Chromium.
Legacy compatibility packages
Section titled “Legacy compatibility packages”@illusions-lab/mdi-to-hast, @illusions-lab/mdi-to-html, @illusions-lab/mdi-to-epub, and @illusions-lab/mdi-to-docx remain published for unified consumers that already hold an mdast/HAST tree. The EPUB and DOCX compatibility entries serialize that tree and delegate final generation to Rust; they no longer carry independent archive generators. The CLI itself does not use these tree-facing entries for build. One current difference worth knowing: @illusions-lab/mdi-to-hast’s stylesheet matches SYNTAX.md more closely than the CSS Rust’s own render_html embeds — see Migration and compatibility: stylesheet parity.
Profile-configured output
Section titled “Profile-configured output”Configured EPUB supports metadata, writing mode, typography, chapter splitting, and PNG/JPEG cover images. Configured DOCX supports metadata, page geometry, mirrored margins, writing mode, typography, strict or flowing grids, and page numbers. Both routes resolve the same export profile in Rust, so future Python, Swift, or Android APIs can expose the same behavior without recreating it.
Next steps
Section titled “Next steps”- Rendering model — the Chromium/PDF boundary and EPUB/DOCX internals in detail.
- Export profiles — the exact per-format support table for profile settings.
- Migration and compatibility — every current spec-vs-implementation gap in one place.