]>
Commit | Line | Data |
---|---|---|
064997fb | 1 | # Building documentation |
60c5eb7d | 2 | |
064997fb FG |
3 | This chapter describes how to build documentation of toolchain components, |
4 | like the standard library (std) or the compiler (rustc). | |
60c5eb7d | 5 | |
064997fb | 6 | - Document everything |
60c5eb7d | 7 | |
064997fb FG |
8 | This uses `rustdoc` from the beta toolchain, |
9 | so will produce (slightly) different output to stage 1 rustdoc, | |
10 | as rustdoc is under active development: | |
6a06907d | 11 | |
064997fb | 12 | ```bash |
add651ee | 13 | ./x doc |
064997fb | 14 | ``` |
60c5eb7d | 15 | |
064997fb | 16 | If you want to be sure the documentation looks the same as on CI: |
60c5eb7d | 17 | |
064997fb | 18 | ```bash |
add651ee | 19 | ./x doc --stage 1 |
064997fb | 20 | ``` |
60c5eb7d | 21 | |
064997fb FG |
22 | This ensures that (current) rustdoc gets built, |
23 | then that is used to document the components. | |
60c5eb7d | 24 | |
064997fb FG |
25 | - Much like running individual tests or building specific components, |
26 | you can build just the documentation you want: | |
60c5eb7d | 27 | |
064997fb | 28 | ```bash |
add651ee FG |
29 | ./x doc src/doc/book |
30 | ./x doc src/doc/nomicon | |
31 | ./x doc compiler library | |
064997fb | 32 | ``` |
60c5eb7d | 33 | |
353b0b11 FG |
34 | See [the nightly docs index page](https://doc.rust-lang.org/nightly/) for a full list of books. |
35 | ||
064997fb | 36 | - Document internal rustc items |
60c5eb7d | 37 | |
064997fb | 38 | Compiler documentation is not built by default. |
add651ee | 39 | To create it by default with `x doc`, modify `config.toml`: |
60c5eb7d | 40 | |
064997fb FG |
41 | ```toml |
42 | [build] | |
43 | compiler-docs = true | |
44 | ``` | |
60c5eb7d | 45 | |
064997fb FG |
46 | Note that when enabled, |
47 | documentation for internal compiler items will also be built. | |
60c5eb7d | 48 | |
064997fb | 49 | NOTE: The documentation for the compiler is found at [this link]. |
60c5eb7d | 50 | |
064997fb | 51 | [this link]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ |