Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,17 @@ defmodule Mob.MixProject do
</script>
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>
<script>
// Activate mermaid diagrams
document.addEventListener("DOMContentLoaded", function () {
mermaid.initialize({ startOnLoad: false });
let id = 0;
for (const codeEl of document.querySelectorAll("pre code.mermaid")) {
const preEl = codeEl.closest("pre");
const graphEl = document.createElement("div");
const graphId = "mermaid-graph-" + id++;
mermaid.render(graphId, codeEl.textContent).then(({ svg, bindFunctions }) => {
graphEl.innerHTML = svg;
if (bindFunctions) bindFunctions(graphEl);
preEl.replaceWith(graphEl);
});
}
mermaid.initialize({ startOnLoad: false, theme: "dark" });
window.mermaid.init(undefined, document.querySelectorAll(".mermaid"));
});
</script>

<script>
// Ensure code blocks with language hints are highlighted
document.querySelectorAll("pre code").forEach(el => {
if (!el.className) el.className = "language-elixir";
});
</script>
"""
Expand Down
Loading