Skip to content

Commit 00a66de

Browse files
committed
Add Katex header and option to include it in Doc.rs
1 parent 75894cf commit 00a66de

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

katex-header.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha256-GQlRJzV+1tKf4KY6awAMkTqJ9/GWO3Zd03Fel8mFLnU=" crossorigin="anonymous">
2+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha256-6NiFUFlJ86X0q91d0NU2lr0Tca0m/79PMQ3Nd8jNrok=" crossorigin="anonymous"></script>
3+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha256-u1PrlTOUUxquNv3VNwZcQkTrhUKQGjzpFGAdkyZ1uKw=" crossorigin="anonymous"></script>
4+
<script>
5+
document.addEventListener("DOMContentLoaded", function() {
6+
renderMathInElement(document.body, {
7+
delimiters: [
8+
{left: "$$", right: "$$", display: true},
9+
{left: "\\(", right: "\\)", display: false},
10+
{left: "$", right: "$", display: false},
11+
{left: "\\[", right: "\\]", display: true}
12+
]
13+
});
14+
});
15+
</script>

swiftnav/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ strum = { version = "0.27", features = ["derive"] }
1717

1818
[dev-dependencies]
1919
float_eq = "1.0.1"
20+
21+
# This tells docs.rs to include the katex header for math formatting
22+
# To do this locally
23+
[package.metadata.docs.rs]
24+
rustdoc-args = [ "--html-in-header", "katex-header.html" ]

0 commit comments

Comments
 (0)