Skip to content

Commit 892bd12

Browse files
committed
Regenerate man pages after documenting cumulative behaviour
1 parent 8d74b2b commit 892bd12

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

src/doc/man/generated_txt/cargo-doc.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@ DESCRIPTION
1010
Build the documentation for the local package and all dependencies. The
1111
output is placed in target/doc in rustdoc’s usual format.
1212

13+
Note: Cargo’s documentation is cumulative. When you run
14+
15+
cargo doc
16+
17+
Cargo will preserve any existing HTML in target/doc/ (including your
18+
dependencies’ docs) rather than deleting it. Flags like --no-deps
19+
simply prevent rebuilding those pages—they will remain until you
20+
explicitly clean them up.
21+
22+
Removing old docs
23+
If you truly want to start fresh, you have two options:
24+
25+
1. cargo clean --doc Deletes all documentation (your crate +
26+
dependencies).
27+
28+
2. Manual deletion To remove only specific dependency folders (for
29+
example: rm -rf target/doc/foo-0.1.0/) without nuking everything
30+
else.
31+
1332
OPTIONS
1433
Documentation Options
1534
--open

src/doc/src/commands/cargo-doc.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,28 @@ cargo-doc --- Build a package's documentation
1212
Build the documentation for the local package and all dependencies. The output
1313
is placed in `target/doc` in rustdoc's usual format.
1414

15+
**Note:** Cargo's documentation is *cumulative*. When you run
16+
17+
```bash
18+
cargo doc
19+
```
20+
21+
Cargo will preserve any existing HTML in `target/doc/` (including your
22+
dependencies' docs) rather than deleting it. Flags like `--no-deps`
23+
simply prevent *rebuilding* those pages—they will remain until you
24+
explicitly clean them up.
25+
26+
### Removing old docs
27+
28+
If you truly want to start fresh, you have two options:
29+
30+
1. **`cargo clean --doc`**
31+
Deletes *all* documentation (your crate + dependencies).
32+
2. **Manual deletion**
33+
To remove only specific dependency folders (for example:
34+
`rm -rf target/doc/foo-0.1.0/`) without nuking everything else.
35+
36+
1537
## OPTIONS
1638

1739
### Documentation Options

src/etc/man/cargo-doc.1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,32 @@ cargo\-doc \[em] Build a package\[cq]s documentation
1010
.SH "DESCRIPTION"
1111
Build the documentation for the local package and all dependencies. The output
1212
is placed in \fBtarget/doc\fR in rustdoc\[cq]s usual format.
13+
.sp
14+
\fBNote:\fR Cargo\[cq]s documentation is \fIcumulative\fR\&. When you run
15+
.sp
16+
.RS 4
17+
.nf
18+
cargo doc
19+
.fi
20+
.RE
21+
.sp
22+
Cargo will preserve any existing HTML in \fBtarget/doc/\fR (including your
23+
dependencies\[cq] docs) rather than deleting it. Flags like \fB\-\-no\-deps\fR
24+
simply prevent \fIrebuilding\fR those pages\[em]they will remain until you
25+
explicitly clean them up.
26+
.SS "Removing old docs"
27+
If you truly want to start fresh, you have two options:
28+
.sp
29+
.RS 4
30+
\h'-04' 1.\h'+01'\fB\fBcargo clean \-\-doc\fB\fR
31+
Deletes \fIall\fR documentation (your crate + dependencies).
32+
.RE
33+
.sp
34+
.RS 4
35+
\h'-04' 2.\h'+01'\fBManual deletion\fR
36+
To remove only specific dependency folders (for example:
37+
\fBrm \-rf target/doc/foo\-0.1.0/\fR) without nuking everything else.
38+
.RE
1339
.SH "OPTIONS"
1440
.SS "Documentation Options"
1541
.sp

0 commit comments

Comments
 (0)