-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'patch-1' of github.com:hbina/rustc-guide into patch-1
- Loading branch information
Showing
8 changed files
with
637 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Documenting rustc | ||
|
||
You might want to build documentation of the various components | ||
available like the standard library. There’s two ways to go about this. | ||
You can run rustdoc directly on the file to make sure the HTML is | ||
correct, which is fast. Alternatively, you can build the documentation | ||
as part of the build process through x.py. Both are viable methods | ||
since documentation is more about the content. | ||
|
||
## Document everything | ||
|
||
```bash | ||
./x.py doc | ||
``` | ||
|
||
## If you want to avoid the whole Stage 2 build | ||
|
||
```bash | ||
./x.py doc --stage 1 | ||
``` | ||
|
||
First the compiler and rustdoc get built to make sure everything is okay | ||
and then it documents the files. | ||
|
||
## Document specific components | ||
|
||
```bash | ||
./x.py doc src/doc/book | ||
./x.py doc src/doc/nomicon | ||
./x.py doc src/doc/book src/libstd | ||
``` | ||
|
||
Much like individual tests or building certain components you can build only | ||
the documentation you want. | ||
|
||
## Document internal rustc items | ||
|
||
Compiler documentation is not built by default. There's a flag in | ||
config.toml for achieving the same. | ||
But, when enabled, compiler documentation does include internal items. | ||
|
||
Next open up config.toml and make sure these two lines are set to true: | ||
|
||
```bash | ||
docs = true | ||
compiler-docs = true | ||
``` | ||
|
||
When you want to build the compiler docs as well run this command: | ||
|
||
```bash | ||
./x.py doc | ||
``` | ||
|
||
This will see that the docs and compiler-docs options are set to true | ||
and build the normally hidden compiler docs! | ||
|
||
### Compiler Documentation | ||
|
||
The documentation for the rust components are found at [rustc doc]. | ||
|
||
[rustc doc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.