Skip to content
Draft

katex #766

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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Concordium.cabal
*.pdf
*.csv
*.svg
*.html

# CMake build folder
build/
Expand Down
4 changes: 4 additions & 0 deletions rust-src/concordium_base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,7 @@ harness = false
[package.metadata.docs.rs]
# Expose the `encryption` feature in documentation.
features = ["encryption"]
rustdoc-args = [
"--html-in-header",
"docs/assets/katex-header.html",
]
23 changes: 23 additions & 0 deletions rust-src/docs/assets/katex-header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-WcoG4HRXMzYzfCgiyfrySxx90XSl2rxY5mnVY5TwtWE6KLrArNKn0T/mOgNL0Mmi" crossorigin="anonymous">

<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-J+9dG2KMoiR9hqcFao0IBLwxt6zpcyN68IgwzsCSkbreXUjmNVRhPFTssqdSGjwQ" crossorigin="anonymous"></script>

<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-hCXGrW6PitJEwbkoStFjeJxv+fSOOQKOPbJxSfM6G5sWZjAyWhXiTIIAmQqnlLlh" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>

<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false},
]
});
});
</script>

<style>
.katex { font-size: 1em !important; }
</style>