Skip to content

Commit

Permalink
Rollup merge of rust-lang#123417 - harryhanYuhao:master, r=GuillaumeG…
Browse files Browse the repository at this point in the history
…omez

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;`
  • Loading branch information
matthiaskrgr committed Apr 4, 2024
2 parents 207b313 + 612acf8 commit 8680f7e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/doc/rustdoc/src/what-is-rustdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ the main page is located in `doc/lib/index.html`. If you open that up in
a web browser, you will see a page with a search bar, and "Crate lib" at the
top, with no contents.

You can also use `cargo doc` to generate documentation for the whole project.
See [Using rustdoc with Cargo](#using-rustdoc-with-cargo).

## Configuring rustdoc

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

Internally, this calls out to `rustdoc` like this:
If you want `cargo` to automatically open the generated documentation, you can use:

```bash
$ cargo doc --open
```

Internally, `cargo doc` calls out to `rustdoc` like this:

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

0 comments on commit 8680f7e

Please sign in to comment.