srid / cargo-doc-live

Flake module to provide live server version of `cargo doc`
MIT License
8 stars 1 forks source link

Add option to configure `cargo doc` arguments #2

Open srid opened 1 year ago

srid commented 1 year ago

https://github.com/srid/cargo-doc-live/blob/fb1d4439d847f01ce4ccf1905d1630c1994569b0/flake-module.nix#L57

Instead of hardcoding --document-private-items --all-features, allow the user to specify them as module options. Eg.:

{
  cargo-doc-live = {
    cargo-doc-args = "--document-private-items --all-features";
  };
}
srid commented 1 year ago

To implement this, simply look at how we defined the crateName option:

https://github.com/srid/cargo-doc-live/blob/fb1d4439d847f01ce4ccf1905d1630c1994569b0/flake-module.nix#L21-L27

srid commented 1 year ago

Looks like we can avoid this option entirely by adding this to Cargo.toml?

[package.metadata.docs.rs]
all-features = true
cargo-args = ["--document-private-items"]

https://docs.rs/about/metadata