Skip to content

Commit 7bf10f2

Browse files
committed
add explainatio for cargo
1 parent ceab612 commit 7bf10f2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
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](#rustdoc-cargo).
39+
3740
## Configuring rustdoc
3841

3942
There are two problems with this: first, why does it
@@ -70,16 +73,17 @@ check it out! It should show a link to the `foo` function's page, which
7073
is located at `doc/docs/fn.foo.html`. On that page, you'll see the "foo is
7174
a function" we put inside the documentation comment in our crate.
7275

73-
## Using rustdoc with Cargo
76+
## <a name="rustdoc-cargo"></a> Using rustdoc with Cargo
7477

7578
Cargo also has integration with `rustdoc` to make it easier to generate
7679
docs. Instead of the `rustdoc` command, we could have done this:
7780

7881
```bash
79-
$ cargo doc
82+
$ cargo doc
83+
$ cargo doc --open # automatically open
8084
```
8185

82-
Internally, this calls out to `rustdoc` like this:
86+
Internally, `cargo doc` calls out to `rustdoc` like this:
8387

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

0 commit comments

Comments
 (0)