Merman: render Mermaid diagrams from the CLI without a browser
Hi r/commandline,
I've been working on Merman, a Rust implementation of Mermaid, and just released v0.8.0. Thought its CLI might be useful to some people here.
It renders Mermaid diagrams without Node.js or Chromium. The goal is to get the same output as official Mermaid: we generate reference SVGs with the official CLI (mmdc) and compare our output against them automatically. Font and browser text measurement can still cause differences.
Zed uses Merman for Mermaid rendering. Other people have been using it in blog generators, Markdown viewers/editors, and CI documentation builds. Their bug reports have helped improve it over the past few releases.
You can install it with:
brew install merman-cli
Or on Windows:
scoop install main/merman-cli
Then:
merman-cli render diagram.mmd
merman-cli render diagram.mmd --format png
merman-cli render diagram.mmd --format unicode --output -
merman-cli batch README.md
It also exports JPEG/PDF and has linting. If you already use mmdc, there's a compatibility command:
merman-cli mmdc -i diagram.mmd -o diagram.svg
The official mmdc and native tools like mmdr are alternatives. My focus with Merman has been matching upstream Mermaid output and fixing compatibility issues as people run into them.
Full disclosure: much of the implementation was bootstrapped with AI coding tools. My work has focused on upstream comparisons, regression tests, reviewing and fixing the implementation, and following up on user reports.
Latias94/merman
If you try it and a diagram breaks or looks different from official Mermaid, I'd appreciate an issue with the source. That's been one of the most useful ways to improve it.
16 points · 12 comments
Mentions
やっぱ個人的に2が一番でかいよな... ズレるかもだけど x.com Zedとかは Latias94/merman を使ってるし、erweixin/RaTeX とかを使えばいけそうではあるけど、GPUIでちょっと試してみた感じ微妙... あとSVG互換性🥲 Web技術のエコシステムが巨大だから仕方ない🥲
That project is just Claude run rampant. Actually attempt to read this: github.com/Latias94/merman/tree/83e3ea74bf4da3008…
There is also Merman on Github that outputs a SVG. Latias94/merman
Merman: render Mermaid diagrams from the CLI without a browser Hi r/commandline, I've been working on Merman, a Rust implementation of Mermaid, and just released v0.8.0. Thought its CLI might be useful to some people here. It renders Mermaid diagrams without Node.js or Chromium. The goal is to get the same output as official Mermaid: we generate reference SVGs with the official CLI (mmdc) and compare our output against them automatically. Font and browser text measurement can still cause differences. Zed uses Merman for Mermaid rendering. Other people have been using it in blog generators, Markdown viewers/editors, and CI documentation builds. Their bug reports have helped improve it over the past few releases. You can install it with: brew install merman-cli Or on Windows: scoop install main/merman-cli Then: merman-cli render diagram.mmd merman-cli render diagram.mmd --format png merman-cli render diagram.mmd --format unicode --output - merman-cli batch README.md It also exports JPEG/PDF and has linting. If you already use mmdc, there's a compatibility command: merman-cli mmdc -i diagram.mmd -o diagram.svg The official mmdc and native tools like mmdr are alternatives. My focus with Merman has been matching upstream Mermaid output and fixing compatibility issues as people run into them. Full disclosure: much of the implementation was bootstrapped with AI coding tools. My work has focused on upstream comparisons, regression tests, reviewing and fixing the implementation, and following up on user reports. Latias94/merman If you try it and a diagram breaks or looks different from official Mermaid, I'd appreciate an issue with the source. That's been one of the most useful ways to improve it.