Skip to content

Commit

Permalink
Rollup merge of rust-lang#71645 - ecstatic-morse:readme-build-doc, r=…
Browse files Browse the repository at this point in the history
…Mark-Simulacrum

Direct contributors to try stage 0 rustdoc first

After rust-lang#71458, `./x.py doc --stage 0 src/libstd` is (empirically) able to build the standard library docs using the `rustdoc` packaged with the bootstrap compiler. This means that new contributors don't need to build the compiler to locally inspect small documentation fixes. This was a roadblock for me when I first started contributing to rust and something that still regularly annoys people. We should recommend that contributors give bootstrap `rustdoc` a try before building the whole compiler.
  • Loading branch information
Dylan-DPC authored May 4, 2020
2 parents 65b4482 + 5577b35 commit ccc123a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,18 @@ You can find documentation style guidelines in [RFC 1574][rfc1574].

[rfc1574]: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text

In many cases, you don't need a full `./x.py doc`. You can use `rustdoc` directly
to check small fixes. For example, `rustdoc src/doc/reference.md` will render
reference to `doc/reference.html`. The CSS might be messed up, but you can
verify that the HTML is right.
In many cases, you don't need a full `./x.py doc`, which will build the entire
stage 2 compiler and compile the various books published on
[doc.rust-lang.org]. When updating documentation for the standard library,
first try `./x.py doc --stage 0 src/libstd`. If that fails, or if you need to
see the output from the latest version of `rustdoc`, use `--stage 1` instead of
`--stage 0`. Results should appear in `build/$TARGET/crate-docs`.

[doc.rust-lang.org]: htts://doc.rust-lang.org

You can also use `rustdoc` directly to check small fixes. For example,
`rustdoc src/doc/reference.md` will render reference to `doc/reference.html`.
The CSS might be messed up, but you can verify that the HTML is right.

Additionally, contributions to the [rustc-dev-guide] are always welcome. Contributions
can be made directly at [the
Expand Down

0 comments on commit ccc123a

Please sign in to comment.