Skip to content

MDI

Markdown for Japanese typography — ruby, tate-chu-yoko, boten, warichu, and vertical writing — parsed once in Rust and rendered identically to HTML, PDF, EPUB, DOCX, and text.
novel.mdi
{雪女|ゆき.おんな}が現れたのは、第^12^話のことだった。
彼は[[em:決して]]忘れないと誓った。

One grammar, one implementation

mdi-core parses CommonMark, GFM, front matter, and every MDI construct into one versioned document IR, in a single pass. No other language or tool contains a second copy of the grammar — see Rust-authoritative architecture.

Japanese typography, for real

Ruby (ルビ), tate-chu-yoko (縦中横), boten (傍点), warichu (割注), kerning, page breaks, and vertical writing are first-class syntax with worked examples, parsed IR, and rendered output for each — see the full syntax reference or the live showcase.

Real publication outputs from one source

renderHtml, renderTextFormat (six flavors, including note, 小説家になろう, and 青空文庫 conventions), renderEpub, renderDocx, and Rust-rendered PDF via Chromium — all implemented today, not planned. See HTML / TXT / EPUB / DOCX / PDF outputs.

Thin, honest language interfaces

Rust, Node.js, Swift, and Python are supported today, all backed by the same Rust core. The Android / Kotlin binding is still in development and is not yet available as a stable public package on Maven Central. See Bindings for platform-specific setup and APIs.

Try it in 30 seconds

npm install --global @illusions-lab/mdi-cli
echo '{雪女|ゆき.おんな}が現れた。第^12^話のことである。' > novel.mdi
mdi build novel.mdi --to html
// or from code:
import { parse, renderHtml } from "@illusions-lab/mdi";

const source = "{雪女|ゆき.おんな}が現れた。第^12^話のことである。";
const { document, diagnostics } = parse(source); // versioned IR + diagnostics
const html = renderHtml(source);                 // <ruby>...<span class="mdi-tcy">12</span>...

Full walkthrough, including PDF/EPUB/DOCX and export profiles, in Getting Started.

Built by illusions.