Skip to content

Commit

Permalink
Fix LaTeX in docs and move katex header
Browse files Browse the repository at this point in the history
  • Loading branch information
HDauven committed Jun 17, 2024
1 parent aab1bc2 commit 80979dd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[build]
# Flags needed to render LaTeX in documentation
# With this, `cargo docs` must be run with the `--no-deps` flag
rustdocflags = "--html-in-header ./docs/katex-header.html"
rustdocflags = "--html-in-header ./katex-header.html"
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ name = "select_point"
required-features = ["alloc"]

[package.metadata.docs.rs]
rustdoc-args = [ "--html-in-header", "./docs/katex-header.html" ]
rustdoc-args = [ "--html-in-header", "./katex-header.html" ]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'

doc: ## Generate documentation
@cargo rustdoc --lib -- --html-in-header docs/katex-header.html -D warnings
@cargo rustdoc --lib -- --html-in-header katex-header.html -D warnings

doc-internal: ## Generate documentation with private items
@cargo rustdoc --lib -- --document-private-items -D warnings

doc-local: ## Open local documentation
@RUSTDOCFLAGS="--html-in-header docs/katex-header.html" cargo doc --no-deps --open
@RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps --open

.PHONY: help doc doc-internal doc-local
8 changes: 7 additions & 1 deletion docs/katex-header.html → katex-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
macros: {
"\\lo": "\\text{lo}",
"\\hi": "\\text{hi}"
}
},
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "\\(", right: "\\)", display: false },
{ left: "$", right: "$", display: false },
{ left: "\\[", right: "\\]", display: true }
]
});
});
</script>
Expand Down

0 comments on commit 80979dd

Please sign in to comment.