Hacker News new | ask | show | jobs
by nickmain 43 days ago
Does the official Mermaid library still require a full or headless browser environment in order to lay out the SVG? If so, Pele is great news for embedding Mermaid rendering in other places.
2 comments

There is also Merman on Github that outputs a SVG.

https://github.com/Latias94/merman

That project is just Claude run rampant. Actually attempt to read this:

https://github.com/Latias94/merman/tree/83e3ea74bf4da30089a8...

Very nice, bookmarked. I built something similar as an Astro plugin using svgdom: https://better-static-sites.github.io/build-tools/mermaid/

It still boggles my mind that mermaid's devs think you need an entire freakin' browser to render an SVG. Sometimes I think people need to be reminded of the fundamentals.

The python mermaidx library works for this, which works well for generating documentation with embedded diagrams as part of CI/CD but the layout/rendering can sometimes be very wonky. For instance I will have a bunch of connections crossing over each other instead of neatly arranged to avoid it. Changing the layout settings does not fix it so sometimes I will just export it from mmdc and embed a png.