Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ITensorDocsNext"
uuid = "701fd796-f527-45da-9a53-2681c1a90c45"
version = "0.1.19"
version = "0.1.20"
authors = ["ITensor developers <support@itensor.org> and contributors"]

[workspace]
Expand Down
5 changes: 3 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Documenter.makedocs(;
sitename = "ITensor ecosystem docs",
modules = [ITensorDocsNext],
warnonly = true,
format = Documenter.HTML(; assets = ["assets/favicon.ico", "assets/extras.css"]),
format = Documenter.HTML(;
assets = ["assets/favicon.ico", "assets/extras.css", "assets/mermaid.js"]
),
# `upgrade_guide.md` is kept in source but left out of the nav until it gets a
# rewrite to match the current next-generation API.
pages = ["index.md", "ecosystem_overview.md"]
Expand Down Expand Up @@ -58,7 +60,6 @@ docs = [
"ITensorBase",
"TensorAlgebra",
"GradedArrays",
"SparseArraysBase",
]
)
),
Expand Down
22 changes: 22 additions & 0 deletions docs/src/assets/mermaid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Since mermaid 11.17.0 the published ESM bundle contains UMD-wrapped dependencies that
// register with the global AMD `define` that Documenter's require.js provides instead of
// exporting themselves, so DocumenterMermaid's unpinned `mermaid@11` import throws before it
// renders anything (https://github.com/mermaid-js/mermaid/issues/8095). Render the diagrams
// here from the last version that works; DocumenterMermaid's own pass then skips them, since
// mermaid ignores diagrams already marked `data-processed`.
const MERMAID = "https://cdn.jsdelivr.net/npm/mermaid@11.16.1/dist/mermaid.esm.min.mjs";

async function renderMermaidDiagrams() {
if (!document.querySelector(".mermaid")) {
return;
}
const { default: mermaid } = await import(MERMAID);
mermaid.initialize({ startOnLoad: false, theme: "neutral" });
await mermaid.run({ querySelector: ".mermaid" });
}

if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", renderMermaidDiagrams);
} else {
renderMermaidDiagrams();
}