Comments
[1]: https://d2lang.com/
Why not
tech that approaches new change with religious recklessness rather than critical thinking will lose out because of users that are tired of regressions and breakages.Styling seems like a trivial problem by comparison.
The playground also has a Compare mode https://pele.run/playground
Edit: So is #7 (and almost #8), #9, 10, 11, 12 are identical as well
Have you given much thought to diffing diagrams? The source can be version controlled and a source diff can be seen, but a visual diff would be amazing and easily sway me from writing prose to writing diagrams.
> Mermaid.js has transitioned to "mermaid.ai" and is losing its original vision. Take a look at their new site.
> The latest version of Mermaid (12.1) ships with yet another layout engine (three now), and has a questionable safety record (see CVEs). In Obsidian 1.13 we had to introduce a new toggle/warning because of potential unsafe Mermaid diagrams.
Good layout is a lot more like writing, in that you have to think about how the intended recipient will perceive and what you want them to notice in which order, and how to make it easy to follow the various relationships
This, in and of itself, is sufficient reason for me to switch, even if it were slower than Mermaid.js.
I’ve not even made it through the list yet and I’m sold.
Much of the work uses SVG as an intermediary so this Pele pattern works great. OP is a TypeScript project, seems great for that ecosystem.
Searching found this go-mermaid library [1] that operates similarly with SVG its target. We have a Golang TUI picture/SVG widget and a Golang WASM/browser embedder, so I just forked it and had an LLM add a live Mermaid/SVG demo using them [2]. The demo is intended for go-mermaid so it uses its rasterizer, composited to our widget.
(took <15 minutes since I had worked similarly just days ago and had the components at the ready, plus could point at Pele; these LLMs are ridiculous at forging from patterns)
Cool thing is that same visual experience can be had in a terminal if it supports Kitty graphics protocol.
I use a build script for my static website that renders markdown files into HTML files and swaps out any mermaid codeblocks with rendered SVGs. I used mermaidjs for this but it is very heavy for this purpose (needs an entire chromium instance for the rendering).
This seemed like a perfect fit for my use case and I already swapped it in. I noticed that the layouts were not 1 to 1, but to my pleasant surprise I actually liked the ones Pele renders better than mermaidjs.
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.
I tried to find the source code of it but I was unable in finding so
Edit: found it, https://github.com/obsidianmd/pele
Also folks, this is a good reminder to please have a github icon on the top of the page to easily show git/github links if the app is open source, also helps in the fact that I can star your projects and bookmark them more easily :-D