]> git.proxmox.com Git - rustc.git/blame - src/doc/rustc-dev-guide/src/building/compiler-documenting.md
New upstream version 1.44.1+dfsg1
[rustc.git] / src / doc / rustc-dev-guide / src / building / compiler-documenting.md
CommitLineData
60c5eb7d
XL
1# Documenting rustc
2
3You might want to build documentation of the various components
4available like the standard library. There’s two ways to go about this.
5You can run rustdoc directly on the file to make sure the HTML is
6correct, which is fast. Alternatively, you can build the documentation
7as part of the build process through x.py. Both are viable methods
8since documentation is more about the content.
9
10## Document everything
11
12```bash
13./x.py doc
14```
15
16## If you want to avoid the whole Stage 2 build
17
18```bash
19./x.py doc --stage 1
20```
21
22First the compiler and rustdoc get built to make sure everything is okay
23and then it documents the files.
24
25## Document specific components
26
27```bash
28./x.py doc src/doc/book
29./x.py doc src/doc/nomicon
30./x.py doc src/doc/book src/libstd
31```
32
33Much like individual tests or building certain components you can build only
34 the documentation you want.
35
36## Document internal rustc items
37
38Compiler documentation is not built by default. To enable it, modify config.toml:
39
40```toml
41[build]
42compiler-docs = true
43```
44
45Note that when enabled,
46documentation for internal compiler items will also be built.
47
48### Compiler Documentation
49
50The documentation for the rust components are found at [rustc doc].
51
ba9703b0 52[rustc doc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/