Hacker News new | past | comments | ask | show | jobs | submit login

Unfortunately, Mermaid can’t render to SVG without a full browser rendering engine. This was my biggest complaint about Mermaid.

There is a command line tool, but it downloads a browser renderer.

Hopefully someone will let me know if this has changed since I looked :)




True. In my case, I'm using Github's built-in Jekyll implementation, and I prefer to keep it as bog-standard as possible, so I went with in-browser rendering. I expect that one day many years hence, something will break and my diagrams will stop working.

One day, I should sit down and manually render them all to .png and update the markdown to use the .pngs instead. But today is not that day. Tomorrow isn't looking too good, either.


I hit this problem when trying to integrate Mermaid into a Swift Package Manager build tool. SPM sandboxes build tool access to specific folders and this causes the headless Chromium used by Mermaid-CLI to blow up.

I'm currently evaluating whether to decouple Mermaid from the browser by using a minimal fake DOM, or just rewriting it in pure Swift. It would be nice if DocC could support Mermaid in Swift doc comments.


It has not!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: