sphinxcontrib-mermaid icon indicating copy to clipboard operation
sphinxcontrib-mermaid copied to clipboard

support mind map graph in mermaid v9.2.0+

Open oglops opened this issue 2 years ago • 0 comments

Newer mind map graph uses lazy loading & async rendering features

which means I have to init mermaid similar to this

    <script type="module">
        import mermaid from '/mermaid/mermaid.esm.min.mjs';
        import mindmap from '/mermaid/mermaid-mindmap.esm.min.mjs';

        const conf = {
        startOnLoad: true,
        };

      async function loadMermaid() {
        await mermaid.registerExternalDiagrams([mindmap]);
        mermaid.initialize(conf);
      }

      await loadMermaid();
    </script>

Can we add a config to make it insert above script when needed ? I can try to make a PR if you think it is worth adding.

oglops avatar Dec 08 '22 20:12 oglops