pretext icon indicating copy to clipboard operation
pretext copied to clipboard

Support Mermaid as a source language for diagrams

Open rbeezer opened this issue 1 year ago • 1 comments

This would be similar to how <latex-image> behaves, but driven by a node executable, not TeX.

Not trivial, but good models exist, and would be a good way for a contributor to touch a lot of code.

https://mermaid.js.org/

rbeezer avatar Feb 25 '24 17:02 rbeezer

What output formats do you want to support?

I think that out of the box, Mermaid tends to produce prettier output than GraphViz (credit to @bjones1 for reminding us of it). But, if you want to output images for use in non-html formats (or for JS-less HTML), that would involve the Mermaid CLI: https://www.npmjs.com/package/@mermaid-js/mermaid-cli/v/8.11.4 Which would involve node. (Node will probably also be necessary for any CSS/JS bundling solution, but this would turn it into a dependency for non-HTML-based builds.).

GraphViz would integrate more tightly with the existing Python build structure. There are libraries for making git history diagrams that might help with the project that got you (@rbeezer) thinking about this. https://github.com/jlinoff/git2dot

ascholerChemeketa avatar Feb 25 '24 23:02 ascholerChemeketa