mdi-core
mdi-core is the native Rust implementation of illusion Markdown (MDI),
a Markdown extension for Japanese typography. It parses CommonMark, GFM, YAML
front matter, and MDI syntax into a portable document tree, and provides
deterministic HTML, text, EPUB, DOCX, and PDF renderers.
Install
[]
= "2.0"
Quick start
use ;
let source = "第^12^話。{東京|とうきょう}は雨だった。";
let document = parse_document;
assert_eq!;
let html = render_html;
Use parse_output when you also need parser capabilities and diagnostics.
When rendering one parsed document in multiple formats, use the
*_document functions, such as render_html_document, to avoid parsing it
again.
Publication profiles are also resolved in Rust. Use
render_epub_with_profile or render_docx_with_profile when you need
metadata, typography, chapter splitting, cover art, page geometry, or page
numbers. page_size_catalog_json exposes the same 67 paper definitions to
bindings and user interfaces, so other languages do not need to copy the
dimension table.
Documentation
License
MIT. See LICENSE.