diff --git a/Cargo.toml b/Cargo.toml index 6467a1df..ae75de55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,3 +61,5 @@ harness = false name = "eigh" harness = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "katex-header.html"] diff --git a/README.md b/README.md index 3271ab12..4d64c034 100644 --- a/README.md +++ b/README.md @@ -77,3 +77,22 @@ extern crate ndarray; extern crate ndarray_linalg; extern crate openblas_src; // or another backend of your choice ``` + +Generate document with KaTeX +------------------------------ + +You need to set `RUSTDOCFLAGS` explicitly: + +```shell +RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps +``` + +This **only** works for `--no-deps` build because `katex-header.html` does not exists for dependent crates. +If you wish to set `RUSTDOCFLAGS` automatically in this crate, you can put [.cargo/config](https://doc.rust-lang.org/cargo/reference/config.html): + +```toml +[build] +rustdocflags = ["--html-in-header", "katex-header.html"] +``` + +But, be sure that this works only for `--no-deps`. `cargo doc` will fail with this `.cargo/config`. diff --git a/katex-header.html b/katex-header.html new file mode 100644 index 00000000..6e10c052 --- /dev/null +++ b/katex-header.html @@ -0,0 +1,16 @@ + + + + +