docmd icon indicating copy to clipboard operation
docmd copied to clipboard

[Feature]: Should the Mermaid plugin use Pele as its renderer?

Open ernoaapa opened this issue 3 weeks ago • 1 comments

Hi, and thanks for docmd!

I recently came across Pele, the new Mermaid renderer from the Obsidian team. It reads the same Mermaid syntax but has its own layout engine and outputs plain SVG. I tried it on a couple of diagrams from our docs and it made me wonder: would it make sense for docmd's Mermaid plugin to use it, or at least offer it as an option?

What stood out to me:

  • The diagrams look better. Flowcharts especially: edges are routed more cleanly and labels sit on the lines.
  • Theming is plain CSS. Colors and fonts come from a handful of CSS variables (--pele-surface, --pele-border, --pele-line, …), so diagrams can follow the site theme without overriding Mermaid's internal styles. Light and dark mode switch without re-rendering.
  • It is much smaller. init-mermaid.js in @docmd/plugin-mermaid 0.9.7 is about 3.4 MB. Pele's browser bundle is about 720 kB (275 kB gzipped), with no runtime dependencies.
  • It can render at build time. render() is synchronous and worked for me in plain Node, so the SVG could go straight into the HTML: no client-side script and no flash of raw diagram text.

Things I'm not sure about:

  • Pele is very new (first released in October 2026), and its layout is not identical to Mermaid.js, so existing diagrams would look a bit different.
  • I don't know how much work it would be to keep the plugin's zoom, fullscreen and download controls working on top of it.

So really a question more than a request: is this something you have looked at, or would consider? An opt-in setting like "mermaid": { "renderer": "pele" } could be a low-risk way to try it. Happy to help test.

ernoaapa avatar Nov 12 '26 06:11 ernoaapa

Really interesting find! Thanks for bringing this up. I’ll definitely look into it.

It seems quite promising and aligns well with docmd’s philosophy of keeping things lightweight and simple.

mgks avatar Nov 12 '26 17:11 mgks