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

14 lines
390 B
JavaScript
Raw Permalink Normal View History

2023-04-24 16:18:54 +02:00
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 });
2023-04-24 16:18:54 +02:00
await mermaid.run({
querySelector: ".language-mermaid",
});
});