@illusions-lab/mdi-to-hast
v2.0.27
Published
mdast (MDI) to hast transform, shared by the HTML/PDF/EPUB converters
Readme
@illusions-lab/mdi-to-hast
Converts an MDI-flavoured mdast tree into HAST and exposes the matching MDI CSS
and remark-rehype handler table. It is for existing unified ecosystems; it
does not parse MDI or decide syntax.
Install
npm install @illusions-lab/mdi-to-hastUsage
import { mdiToHast, MDI_STYLESHEET } from "@illusions-lab/mdi-to-hast";
const { hast, frontmatter } = mdiToHast(mdastTree);
console.log(hast, frontmatter, MDI_STYLESHEET);For complete .mdi source, prefer renderHtml() from
@illusions-lab/mdi: Rust
parses and renders the document directly. Use this package only when a unified
pipeline already owns an mdast tree.
