Hacker News new | ask | show | jobs
by candiddevmike 989 days ago
I wish there was a way to easily export mermaid diagrams to PNG or PDF. Right now sharing the diagrams, especially ones that scroll, is a pain in the ass.
5 comments

You can export to PNG and other formats in the Mermaid editor https://mermaid.live/
This could be rewritten to save locally or an endpoint you run: https://github.com/kordless/mitta-screenshot. The code is in background.js. Just fullscreen the graph then click the icon.
On the other hand, sharing via images isn't good, because the recipient loses accessibility. Probably better to just share the original in most cases.
Mermaid for message sequence diagrams is amazing -- we recently added 'GPT for diagramming' support to Louie (conversational data & compute notebooks), and combining these rich DSLs with conversational AI & an interactive UI is a pretty cool & time-saving experience because it can bootstrap a lot

Example from work where the original took 1-2 hours: https://www.loom.com/share/aa388d49f28d471d89e3d8c048e9c0a0

It's amazing to think where these will be even 6mo from now

Since GitHub renders mermaid, you could simply share a link to a gist.