mylloon.fr/static/js/libs/mermaid.js

13 lines
390 B
JavaScript

import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs";
window.addEventListener("load", async () => {
const theme = window.matchMedia("(prefers-color-scheme: dark)").matches
? "dark" // dark
: "default"; // light
mermaid.initialize({ startOnLoad: false, theme: theme });
await mermaid.run({
querySelector: ".language-mermaid",
});
});