Skip to content

Commit

Permalink
Auto merge of #11568 - jofas:fix_for_11555, r=weihanglo
Browse files Browse the repository at this point in the history
Fix for #11555

Fix for #11555. I more or less blindly followed the instructions given by `@weihanglo` in the description of the issue:

1. I replaced every link from `doc.crates.io/contrib/apidoc/cargo` with `doc.rust-lang.org/nightly/nightly-rustc/cargo`
2. Added redirection rule to `src/doc/contrib/book.toml` that should redirect the `/apidoc/cargo/` endpoint to `https://doc.rust-lang.org/nightly/nightly-rustc/cargo`
3. Reverted the changes made to the CI workflow in ba3d2e9 and 1c82d9c (building the api docs as part of the contribution guide)
  • Loading branch information
bors committed Jan 12, 2023
2 parents abc6abe + 9fec8d6 commit 1cd6d38
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ jobs:
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.9/mdbook-v0.4.9-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Update toolchain
run: rustup update --no-self-update stable && rustup default stable
- name: Build API doc
run: |
cargo doc --document-private-items --no-deps
- name: Deploy docs
run: |
cd src/doc/contrib
Expand All @@ -38,8 +33,6 @@ jobs:
git update-ref -d refs/heads/gh-pages
rm -rf contrib
mv ../book contrib
# Move rustdoc under contrib/
mv ../../../../target/doc contrib/apidoc
git add contrib
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
- External subcommands can now inherit jobserver file descriptors from Cargo.
[#10511](https://github.com/rust-lang/cargo/pull/10511)
- Added an API documentation for private items in cargo-the-library. See
<https://doc.crates.io/contrib/apidoc/cargo>.
<https://doc.rust-lang.org/nightly/nightly-rustc/cargo>.
[#11019](https://github.com/rust-lang/cargo/pull/11019)

### Changed
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//! There are two places you can find API documentation of cargo-the-library,
//!
//! - <https://docs.rs/cargo> and
//! - <https://doc.crates.io/contrib/apidoc/cargo>.
//! - <https://doc.rust-lang.org/nightly/nightly-rustc/cargo>.
//!
//! Each of them targets on a slightly different audience.
//!
Expand All @@ -33,7 +33,7 @@
//!
//! ## For Cargo contributors
//!
//! The documentation on <https://doc.crates.io/contrib/apidoc/cargo> contains all items in Cargo.
//! The documentation on <https://doc.rust-lang.org/nightly/nightly-rustc/cargo> contains all items in Cargo.
//! Contributors of Cargo may find it useful as a reference of Cargo's implementation details.
//! It's built with `--document-private-items` rustdoc flag,
//! so you might expect to see some noise and strange items here.
Expand Down
3 changes: 3 additions & 0 deletions src/doc/contrib/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ authors = ["Eric Huss"]

[output.html]
git-repository-url = "https://github.com/rust-lang/cargo/tree/master/src/doc/contrib/src"

[output.html.redirect]
"/apidoc/cargo/index.html" = "https://doc.rust-lang.org/nightly/nightly-rustc/cargo/"

0 comments on commit 1cd6d38

Please sign in to comment.