diff --git a/.cargo/config.toml b/.cargo/config.toml index 69931cee..45715570 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -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" diff --git a/Cargo.toml b/Cargo.toml index 79b7adb0..aee1399e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" ] diff --git a/Makefile b/Makefile index b6328ef0..d91258cf 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/docs/katex-header.html b/katex-header.html similarity index 77% rename from docs/katex-header.html rename to katex-header.html index 4a840d38..a2ff28ae 100644 --- a/docs/katex-header.html +++ b/katex-header.html @@ -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 } + ] }); });