What is this?
Ondine compiles Mermaid-syntax diagrams ahead of time into static SVG, so your pages ship plain SVG instead of a JS rendering library like Mermaid.js.
Is it a single CLI tool or a library I import?
It is a small toolkit: a CLI (the ondine command), a Vite plugin for .mmd imports, a Node compiler module, and an opt-in in-browser WASM compiler, covering different ways to use it.
How do I start using it in a project?
Add the Vite plugin to import .mmd files directly, run the ondine CLI on files or stdin, or import ondine/compiler in a Node script; the documentation covers each path in detail.
Do I need to rewrite my existing Mermaid diagrams?
No, every diagram accepts the same input syntax as Mermaid, so existing .mmd files work with Ondine unchanged.
Is browser-side compilation included by default?
No, in-browser compilation is opt-in: you have to explicitly load ondine/compiler/wasm modules, either one per diagram type or all of them, since the normal workflow compiles ahead of build time.
Can I embed Ondine diagrams directly in GitHub README files?
Yes, an image Worker renders diagrams encoded in a URL, so compiled SVG diagrams can be embedded straight into GitHub READMEs without a build step.
Can I restyle diagrams without recompiling them?
Yes, Ondine exposes CSS custom properties prefixed --ondine- that switch color schemes on the fly, with no recompilation needed.
How small is the runtime needed to display the diagrams?
Just a 210-byte gzipped runtime — the mount() function inserts precompiled SVG without downloading any parser or layout engine.
Is Ondine free to use?
Yes, it is released under the MIT license.
What are similar projects?
tsrs, oxc, marked, lollipop-css, liteparse, rollup, mitex, english-rs
Which topics is it in?
diagrams-as-code, mdx, webassembly, lightweight, themes, node, rendering, svg, compiler, github, vite, wasm