Closed RichardJECooke closed 3 months ago
The right way to do it is to create an Asciidoctor extension that relies on a "browser environment" to render a Mermaid diagram.
You can take inspiration from the Asciidoctor Kroki extension. We would also need to find a solution to give this extension priority over Kroki when rendering a Mermaid diagram.
Hi, has this feature been prioritized yet?
Is your feature request related to a problem? Please describe
Having to contact a server (kroki) and also save diagrams on disk (instead of using only plain text) is annoying. Diagrams can't be stored well in git, and I don't want to send my info to kroki, or bother setting up a local server just to make a diagram.
Describe the solution you'd like
There is already a mermaid.js extension for vs code that creates diagrams from text in Electron in real time, that doesn't need any server or need to save image files. Please add some syntax to allow this extension to be used by the asciidoctor extension. If I have time I'll look into writing this myself.
Describe alternatives you've considered
No alternative diagram languages that I know of. They don't have VS code extensions, or are commercially licensed: https://hackernoon.com/my-top-13-javascript-diagram-libraries-g2a53z6u
Also, Mermaid is the default in Github - https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/.
The only real alternative is to use markdown files in VS Code instead of asciidoc files. But then you lose some good features like numbered headings.