From ecc01069a48098347ea4512791774c9f8f98e72f Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Fri, 5 Dec 2025 08:47:20 +0000 Subject: [PATCH 1/2] Remove links to rust-random.github.io/rand --- src/contrib-doc.md | 11 +---------- src/intro.md | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/contrib-doc.md b/src/contrib-doc.md index 0f9a6db..af9d9b5 100644 --- a/src/contrib-doc.md +++ b/src/contrib-doc.md @@ -39,9 +39,6 @@ After editing API documentation, we recommend testing examples: cargo test --doc ``` -Rand API docs are automatically built and hosted at -[rust-random.github.io/rand] for the latest code in master. - ### Getrandom crate The [rust-random/getrandom](https://github.com/rust-random/getrandom) @@ -64,12 +61,7 @@ When referring to an item from within another crate, 1. if that item is accessible via a crate dependency (even if not via the public API), use the Rust item path -2. when linking to another crate within the `rust-random/rand` repository, - relative paths within the generated documentation files (under `target/doc`) - can be used; these work on [rust-random.github.io/rand] but not - currently on `docs.rs` (see [docs#204]) -3. if neither of the above are applicable, use an absolute link -4. consider revising documentation, e.g. refer to the crate instead +2. otherwise, use an absolute link to docs.rs Examples: @@ -129,5 +121,4 @@ API documentation: ln -s ../rand/target/doc rand ``` -[rust-random.github.io/rand]: https://rust-random.github.io/rand [docs#204]: https://github.com/rust-lang/docs.rs/issues/204 diff --git a/src/intro.md b/src/intro.md index 3a92782..0738773 100644 --- a/src/intro.md +++ b/src/intro.md @@ -13,6 +13,5 @@ This book contains: Outside this book, you may want: - [API reference for the latest release](https://docs.rs/rand/) -- [API reference for the master branch](https://rust-random.github.io/rand/) - [The Rand repository](https://github.com/rust-random/rand/) - [The Book source](https://github.com/rust-random/book/) From eda1937e899d1bfc68436a89134f2607fd523d93 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Fri, 5 Dec 2025 08:47:52 +0000 Subject: [PATCH 2/2] Tweak contrib-doc on building docs --- src/contrib-doc.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/contrib-doc.md b/src/contrib-doc.md index af9d9b5..b53243b 100644 --- a/src/contrib-doc.md +++ b/src/contrib-doc.md @@ -21,12 +21,13 @@ To build all API documentation for all crates in the [rust-random/rand](https://github.com/rust-random/rand) repository, run: ```sh -# Build doc for all modules: -cargo doc --all --no-deps +# Optionally, enable some unstable but widely used doc features: +export RUSTDOCFLAGS="--cfg docsrs -Zunstable-options --generate-link-to-definition" -# And open it: -xdg-open target/doc/rand/index.html +# Build doc for all crates in the workspace: +cargo doc --workspace --no-deps --all-features --open ``` +(Alternatively, check the `Cargo.toml` under `[package.metadata.docs.rs]` which may suggest workspace- or crate-specific configuration.) On Linux, it is easy to set up automatic rebuilds after any edit: ```sh