1 # Building documentation
3 This chapter describes how to build documentation of toolchain components,
4 like the standard library (std) or the compiler (rustc).
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:
16 If you want to be sure the documentation looks the same as on CI:
22 This ensures that (current) rustdoc gets built,
23 then that is used to document the components.
25 - Much like running individual tests or building specific components,
26 you can build just the documentation you want:
29 ./x.py doc src/doc/book
30 ./x.py doc src/doc/nomicon
31 ./x.py doc compiler library
34 See [the nightly docs index page](https://doc.rust-lang.org/nightly/) for a full list of books.
36 - Document internal rustc items
38 Compiler documentation is not built by default.
39 To create it by default with `x.py doc`, modify `config.toml`:
46 Note that when enabled,
47 documentation for internal compiler items will also be built.
49 NOTE: The documentation for the compiler is found at [this link].
51 [this link]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/