Skip to content

Commit 50603cb

Browse files
authoredApr 5, 2024
Rollup merge of #123417 - harryhanYuhao:master, r=GuillaumeGomez
Add Description for cargo in rustdoc documentation As most people use cargo now, I prioritised the description for cargo in rustdoc documentation. I also added how to open the generated doc with cargo. Btw, may I ask how to use `./x tidy`? It says `warning: `tidy` is not installed;`
2 parents ac29872 + 612acf8 commit 50603cb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
 

‎src/doc/rustdoc/src/what-is-rustdoc.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ the main page is located in `doc/lib/index.html`. If you open that up in
3434
a web browser, you will see a page with a search bar, and "Crate lib" at the
3535
top, with no contents.
3636

37+
You can also use `cargo doc` to generate documentation for the whole project.
38+
See [Using rustdoc with Cargo](#using-rustdoc-with-cargo).
39+
3740
## Configuring rustdoc
3841

3942
There are two problems with this: first, why does it
@@ -79,7 +82,13 @@ docs. Instead of the `rustdoc` command, we could have done this:
7982
$ cargo doc
8083
```
8184

82-
Internally, this calls out to `rustdoc` like this:
85+
If you want `cargo` to automatically open the generated documentation, you can use:
86+
87+
```bash
88+
$ cargo doc --open
89+
```
90+
91+
Internally, `cargo doc` calls out to `rustdoc` like this:
8392

8493
```bash
8594
$ rustdoc --crate-name docs src/lib.rs -o <path>/docs/target/doc -L

0 commit comments

Comments
 (0)
Please sign in to comment.