-
Notifications
You must be signed in to change notification settings - Fork 3
/
docs-head.html
49 lines (48 loc) · 2.33 KB
/
docs-head.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
<!-- Mermaid (charts) dependency -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.9.0/mermaid.min.js"></script>
<script>
window.onload = function (_) {
// Once document is loaded, we init mermaid with a specific set of html elements (since
// we don't use standard class).
// We also add a special class to chart parents so we can style them.
var charts = document.querySelectorAll(".language-mermaid > code");
for (var i = 0; i < charts.length; i++) {
charts[i].parentElement.classList.add("mermaid-parent");
}
// Init mermaid - the callback enables math rendering in charts.
mermaid.init(undefined, charts, function (id) {
renderMathInElement(document.getElementById(id), {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "\\(", right: "\\)", display: false},
{left: "$", right: "$", display: false},
{left: "\\[", right: "\\]", display: true}
]
});
});
}
</script>
<!-- Some extra CSS to make mermaid charts nicer -->
<style>
.mermaid-parent {
margin: 16px auto;
width: fit-content;
text-align: center;
}
</style>
<!-- Include KaTeX for math rendering -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "\\(", right: "\\)", display: false},
{left: "$", right: "$", display: false},
{left: "\\[", right: "\\]", display: true}
]
});
});
</script>