Skip to content

Commit 67af5ca

Browse files
committed
revamp doc-build chapter
1 parent ea7e58a commit 67af5ca

File tree

1 file changed

+35
-39
lines changed

1 file changed

+35
-39
lines changed

Diff for: src/building/compiler-documenting.md

+35-39
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,51 @@
11
# Building documentation
22

3-
You might want to build documentation of the various components
4-
available like the standard library. There’s two ways to go about this.
5-
You can run rustdoc directly on the file to make sure the HTML is
6-
correct, which is fast. Alternatively, you can build the documentation
7-
as part of the build process through `x.py`. Both are viable methods
8-
since documentation is more about the content.
3+
You can run `rustdoc` directly on a file to make sure the HTML is correct,
4+
which runs quickly.
5+
A more conventional way is using `/x.py doc`.
96

10-
## Document everything
7+
- Document everything
118

12-
This uses the beta rustdoc, which usually but not always has the same output
13-
as stage 1 rustdoc.
9+
This uses `rustdoc` from the beta toolchain,
10+
so will produce (slightly) different output to stage 1 rustdoc,
11+
as `rustdoc` is under active development:
1412

15-
```bash
16-
./x.py doc
17-
```
13+
```bash
14+
./x.py doc
15+
```
1816

19-
## If you want to be sure that the links behave the same as on CI
17+
If you want to be sure the documentation looks the same as on CI:
2018

21-
```bash
22-
./x.py doc --stage 1
23-
```
19+
```bash
20+
./x.py doc --stage 1
21+
```
2422

25-
First the compiler and rustdoc get built to make sure everything is okay
26-
and then it documents the files.
23+
First,
24+
the compiler and rustdoc get built to make sure everything is okay,
25+
and then it documents the files.
2726

28-
## Document specific components
27+
- Much like running individual tests or building specific components,
28+
you can build just the documentation you want:
2929

30-
```bash
31-
./x.py doc src/doc/book
32-
./x.py doc src/doc/nomicon
33-
./x.py doc src/doc/book library
34-
```
30+
```bash
31+
./x.py doc src/doc/book
32+
./x.py doc src/doc/nomicon
33+
./x.py doc compiler library
34+
```
3535

36-
Much like individual tests or building certain components you can build only
37-
the documentation you want.
36+
- Document internal rustc items
3837

39-
## Document internal rustc items
38+
Compiler documentation is not built by default.
39+
To enable it, modify "config.toml":
4040

41-
Compiler documentation is not built by default. To enable it, modify config.toml:
41+
```toml
42+
[build]
43+
compiler-docs = true
44+
```
4245

43-
```toml
44-
[build]
45-
compiler-docs = true
46-
```
46+
Note that when enabled,
47+
documentation for internal compiler items will also be built.
4748

48-
Note that when enabled,
49-
documentation for internal compiler items will also be built.
49+
NOTE: The documentation for the compiler is found at [this link].
5050

51-
### Compiler Documentation
52-
53-
The documentation for the Rust components are found at [rustc doc].
54-
55-
[rustc doc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/
51+
[this link]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/

0 commit comments

Comments
 (0)