Skip to content

Commit eda1937

Browse files
committed
Tweak contrib-doc on building docs
1 parent ecc0106 commit eda1937

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/contrib-doc.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ To build all API documentation for all crates in the
2121
[rust-random/rand](https://github.com/rust-random/rand) repository, run:
2222

2323
```sh
24-
# Build doc for all modules:
25-
cargo doc --all --no-deps
24+
# Optionally, enable some unstable but widely used doc features:
25+
export RUSTDOCFLAGS="--cfg docsrs -Zunstable-options --generate-link-to-definition"
2626

27-
# And open it:
28-
xdg-open target/doc/rand/index.html
27+
# Build doc for all crates in the workspace:
28+
cargo doc --workspace --no-deps --all-features --open
2929
```
30+
(Alternatively, check the `Cargo.toml` under `[package.metadata.docs.rs]` which may suggest workspace- or crate-specific configuration.)
3031

3132
On Linux, it is easy to set up automatic rebuilds after any edit:
3233
```sh

0 commit comments

Comments
 (0)