Rust Core API の状況
前提: Document IR。このページは mdi-core/src/lib.rs にあるものだけを記載します。自動 cargo doc site は Planned です。食い違いがあれば source を正としてください。
Constants
Section titled “Constants”MDI_SPEC_VERSION: &str = "2.0"MDI_IR_VERSION: &str = "1.0"MDI_STYLESHEET: &str—render_htmlに埋め込まれる CSS。 stylesheet parity を参照。
Parsing
Section titled “Parsing”parse_document(source: &str) -> Document— 完全な一回解析。parse_output(source: &str) -> ParseOutput— versioned envelope。parse_json(source: &str) -> String— FFI が渡る JSON。parse_inlines(source: &str) -> Vec<Inline>— MDI inline 専用。parse_mdi_syntax(source: &str) -> MdiSyntaxDocument— deprecated 互換 API。
Serialization
Section titled “Serialization”serialize_mdi(source: &str) -> String / serialize_mdi_document(document: &Document) -> String は canonical MDI/Markdown に serialize します。例えば 《《text》》 を `text` に正規化します。
Rendering
Section titled “Rendering”render_html/render_html_document→ standalone HTMLrender_text/render_text_document→ plaintxtrender_text_format(source, format: TextFormat, indent_prefix)→txt、txt-ruby、narou、kakuyomu、aozorarender_epub/render_epub_document→Result<Vec<u8>, String>EPUB 3render_docx/render_docx_document→Result<Vec<u8>, String>DOCXrender_pdf(source, options: &PdfOptions)→ local Chromium による PDFfind_chromium() -> Option<PathBuf>→ Chromium の best-effort search
Public data types
Section titled “Public data types”current-generation API は ParseOutput、ParserCapabilities、Diagnostic、SourceSpan、Document、Frontmatter、PdfOptions です。旧 shape は MdiSyntaxDocument、MdiBlock、PagebreakVariant、Inline、RubyReading です。
Not yet implemented
Section titled “Not yet implemented”parse_outputと別個の validation API はありません。serialize_mdiと別個の normalize API はありません。- export-profile-aware EPUB/DOCX(cover、chapter split、page geometry、font)はありません。
- DOCX の ruby run、boten style、page geometry はありません。現在は typography を plain text に flatten します。