Closed suda-morris closed 8 months ago
Any update on this? Would it be an option to also allow downloading the latest or a specific version of mermaid when executing mdbook-mermaid install
. Then it would not be necessary to touch mdbook-mermaid every time a new mermaid release is available.
mdbook-mermaid install
is a convenience command to drop the required files into your folder. If you need a different, more recent version you can do that by downloadig it manually and putting the files in the right place.
I won't add more complex code for arbitrary downloads. I didn't have time to update to v10 yet and currently it's not a priority for me.
It's easy to add mermaid-js v10 manually
additional-js = ["mermaid.min.js", "mermaid-init.js"]
from book.toml
theme/head.hbs
containing
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true });
</script>
theme/head.hbs
is relative to the project root (so theme
is a sibling of src
). This is just a note for those like me who stupidly added it to the transient 'book' directory and wondered why it kept disappearing ;-)
Works really well - thanks @char101
for me, this solution works on github pages, but when do print, it can not use the V10.
From a quick bit of playing, it seems like we can overwrite the local copy of mermaid. It gets picked up and used buy the build:
curl -LO https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js
Beware of local browser cache!
According to https://github.com/mermaid-js/mermaid/releases/tag/v10.0.0 mermaid has dropped the CJS support.