Skip to content

Commit 6b50a4c

Browse files
authored
Rollup merge of #70014 - TimotheeGerber:small-fix-rustdoc-book, r=Dylan-DPC
Small fixes in rustdoc book I read the `rustdoc` book today and noticed some small typos/problems. Mainly: - `# fn foo() {}` was displayed when not needed because fenced block code type was `text` instead of `rust`; - two path separators were missing and some Windows-style separators were not consistent with the rest of them (mainly Linux-style). Here are my proposed fixes. It is my first PR for the rust project. Don't hesitate to tell me if I am doing it wrong or if you need anything else. Have a nice day!
2 parents 9296d77 + 6d521ec commit 6b50a4c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/doc/rustdoc/src/advanced-features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The features listed on this page fall outside the rest of the main categories.
44

55
## `#[cfg(doc)]`: Documenting platform-/feature-specific information
66

7-
For conditional compilation, Rustdoc treats your crate the same way the compiler does: Only things
7+
For conditional compilation, Rustdoc treats your crate the same way the compiler does. Only things
88
from the host target are available (or from the given `--target` if present), and everything else is
99
"filtered out" from the crate. This can cause problems if your crate is providing different things
1010
on different targets and you want your documentation to reflect all the available items you

src/doc/rustdoc/src/command-line-arguments.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ Rustdoc only supports HTML output, and so this flag is redundant today.
7979
Using this flag looks like this:
8080

8181
```bash
82-
$ rustdoc src/lib.rs -o target\\doc
83-
$ rustdoc src/lib.rs --output target\\doc
82+
$ rustdoc src/lib.rs -o target/doc
83+
$ rustdoc src/lib.rs --output target/doc
8484
```
8585

8686
By default, `rustdoc`'s output appears in a directory named `doc` in

src/doc/rustdoc/src/documentation-tests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ only shows the part you care about.
314314
`should_panic` tells `rustdoc` that the code should compile correctly, but
315315
not actually pass as a test.
316316

317-
```text
317+
```rust
318318
/// ```no_run
319319
/// loop {
320320
/// println!("Hello, world");

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ $ cargo doc
7878
Internally, this calls out to `rustdoc` like this:
7979

8080
```bash
81-
$ rustdoc --crate-name docs srclib.rs -o <path>\docs\target\doc -L
82-
dependency=<path>docs\target\debug\deps
81+
$ rustdoc --crate-name docs src/lib.rs -o <path>/docs/target/doc -L
82+
dependency=<path>/docs/target/debug/deps
8383
```
8484

8585
You can see this with `cargo doc --verbose`.
@@ -128,4 +128,4 @@ Cargo currently does not understand standalone Markdown files, unfortunately.
128128
## Summary
129129

130130
This covers the simplest use-cases of `rustdoc`. The rest of this book will
131-
explain all of the options that `rustdoc` has, and how to use them.
131+
explain all of the options that `rustdoc` has, and how to use them.

0 commit comments

Comments
 (0)