-
Hello internet! I am working on a simple tool allows someone to render a Mermaid diagram in a webpage with minimal HTML/Javasript code. The JS code is here: https://github.com/obaqueiro/mermaid-js-auto-renderer/blob/main/mermaid-js-autorenderer.js
Pretty simple. The idea is that opening a file with a content like this in the browser will yield a full diagram:
(go ahead and try that in an HTML file) The problem I encounter is that, when I add some
I wonder if I am missing some format or am using the library in the wrong way. Any help is appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
OK so GPT gave me the answer. Apparently directives I make the necessary changes and it works! https://cdn.jsdelivr.net/gh/obaqueiro/mermaid-js-auto-renderer@main/mermaid-js-autorenderer.js |
Beta Was this translation helpful? Give feedback.
OK so GPT gave me the answer. Apparently directives
%%
are not parsed by the JS mermaid library but have to be setup using theinitialize
function.I make the necessary changes and it works!
https://cdn.jsdelivr.net/gh/obaqueiro/mermaid-js-auto-renderer@main/mermaid-js-autorenderer.js