Replies: 3 comments 4 replies
-
By the way, I tested the same code in HTML5!
The result is as follows: ![]() Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello @vcdemy, This is my only lead, as I personally never used Mermaid module extensions. I only did some Mermaid style injection via patching the minified JS but this doesn't really apply to enabling modules or maybe I'm missing something 🤔 |
Beta Was this translation helpful? Give feedback.
-
Hi @kamilkrzyskow, Hmmm... I am not very familiar with frontend stuff... so I temporarily used the following method as a workaround. In markdown_extensions:
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_div_format
extra_javascript:
- js/mermaid.mjs The In import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
import zenuml from 'https://cdn.jsdelivr.net/npm/@mermaid-js/[email protected]/dist/mermaid-zenuml.esm.min.mjs';
await mermaid.registerExternalDiagrams([zenuml]);
mermaid.initialize({
startOnLoad: true,
sequence: {
actorFontSize: "16px", // Hack: mitigate https://bit.ly/3y0NEi3
messageFontSize: "16px",
noteFontSize: "16px"}
});
window.mermaid = mermaid; Then, let the new mermaid module convert the div block to mermaid diagrams. This worked fine. It's just that you will see the raw text before the diagram shows up. ![]() Therefore, I hide the That is, create a div.mermaid {color:transparent;} And add the following to extra_css:
- css/extra.css Now it looks better. ![]() |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I am trying to add mermaid zenuml to material for mkdocs, but the zenuml diagram was not shown as expected.
What I did is as follows:
mermaid.mjs
to register zenumlmermaid.mjs
fromextra_javascript
section inmkdocs.yml
index.md
to test zenumlThe code is as follows:
docs/javascript/mermaid.mjs
,(Actually I modified the code from here -> diagram customization )
In
mkdocs.yml
:In
index.md
:The result is as follows:

Does anyone know what I missed?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions