-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs-header.html
52 lines (49 loc) · 1.68 KB
/
docs-header.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV"
crossorigin="anonymous"
/>
<script
defer
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"
integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8"
crossorigin="anonymous"
></script>
<script
defer
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js"
integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/mermaid.min.js"
integrity="sha256-4XUY29zwNw113fj/hwDto4DsA6gxjC2PaJ8BRRtwlAc="
crossorigin="anonymous"
></script>
<script>
// the mermaid part is from https://github.com/rust-lang/mdBook/issues/762
function patchMermaidCodeElementClass() {
var elements = document.getElementsByClassName("language-mermaid");
Array.from(elements).forEach((pre) => {
Array.from(pre.childNodes).forEach((code) => {
if (code.tagName.toLowerCase() == "code") {
code.className = "mermaid";
}
});
});
}
document.addEventListener("DOMContentLoaded", function () {
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
{ left: "\\(", right: "\\)", display: false },
{ left: "\\[", right: "\\]", display: true },
],
throwOnError: false,
});
patchMermaidCodeElementClass();
mermaid.initialize({ startOnLoad: true });
});
</script>