Skip to content

Commit 2250707

Browse files
committed
revamp doc-build chapter
1 parent dca7b1b commit 2250707

File tree

1 file changed

+36
-38
lines changed

1 file changed

+36
-38
lines changed

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

+36-38
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,53 @@
11
# Documenting rustc
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 the beta 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+
- Document specific components
2928

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-
```
29+
```bash
30+
./x.py doc src/doc/book
31+
./x.py doc src/doc/nomicon
32+
./x.py doc compiler library
33+
```
3534

36-
Much like individual tests or building certain components you can build only
37-
the documentation you want.
35+
Much like running individual tests or building specific components,
36+
you can build just the documentation you want.
3837

39-
## Document internal rustc items
38+
- Document internal rustc items
4039

41-
Compiler documentation is not built by default. To enable it, modify config.toml:
40+
Compiler documentation is not built by default.
41+
To enable it, modify config.toml:
4242

43-
```toml
44-
[build]
45-
compiler-docs = true
46-
```
43+
```toml
44+
[build]
45+
compiler-docs = true
46+
```
4747

48-
Note that when enabled,
49-
documentation for internal compiler items will also be built.
48+
Note that when enabled,
49+
documentation for internal compiler items will also be built.
5050

51-
### Compiler Documentation
51+
NOTE: The documentation for the compiler is found at [this link].
5252

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/
53+
[this link]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/

0 commit comments

Comments
 (0)