From 68dc24fcbebbd529e44d9ecba9bcdeff68268555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Gerber?= Date: Sat, 14 Mar 2020 23:04:33 +0100 Subject: [PATCH 1/3] Clean up path separator in rustdoc book --- src/doc/rustdoc/src/command-line-arguments.md | 4 ++-- src/doc/rustdoc/src/what-is-rustdoc.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/doc/rustdoc/src/command-line-arguments.md b/src/doc/rustdoc/src/command-line-arguments.md index 2e32ce31ecae0..ddbe26389fdc8 100644 --- a/src/doc/rustdoc/src/command-line-arguments.md +++ b/src/doc/rustdoc/src/command-line-arguments.md @@ -79,8 +79,8 @@ Rustdoc only supports HTML output, and so this flag is redundant today. Using this flag looks like this: ```bash -$ rustdoc src/lib.rs -o target\\doc -$ rustdoc src/lib.rs --output target\\doc +$ rustdoc src/lib.rs -o target/doc +$ rustdoc src/lib.rs --output target/doc ``` By default, `rustdoc`'s output appears in a directory named `doc` in diff --git a/src/doc/rustdoc/src/what-is-rustdoc.md b/src/doc/rustdoc/src/what-is-rustdoc.md index bbcacb7f3d5d9..adcebc832bc0b 100644 --- a/src/doc/rustdoc/src/what-is-rustdoc.md +++ b/src/doc/rustdoc/src/what-is-rustdoc.md @@ -78,8 +78,8 @@ $ cargo doc Internally, this calls out to `rustdoc` like this: ```bash -$ rustdoc --crate-name docs srclib.rs -o \docs\target\doc -L -dependency=docs\target\debug\deps +$ rustdoc --crate-name docs src/lib.rs -o /docs/target/doc -L +dependency=/docs/target/debug/deps ``` You can see this with `cargo doc --verbose`. @@ -128,4 +128,4 @@ Cargo currently does not understand standalone Markdown files, unfortunately. ## Summary This covers the simplest use-cases of `rustdoc`. The rest of this book will -explain all of the options that `rustdoc` has, and how to use them. \ No newline at end of file +explain all of the options that `rustdoc` has, and how to use them. From 131433a2c0bb67d84671c7a97eeddfbc6983b913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Gerber?= Date: Sat, 14 Mar 2020 23:31:34 +0100 Subject: [PATCH 2/3] Change fenced code block type in rustdoc book --- src/doc/rustdoc/src/documentation-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/rustdoc/src/documentation-tests.md b/src/doc/rustdoc/src/documentation-tests.md index 96fa4344b04b7..78181156e250f 100644 --- a/src/doc/rustdoc/src/documentation-tests.md +++ b/src/doc/rustdoc/src/documentation-tests.md @@ -314,7 +314,7 @@ only shows the part you care about. `should_panic` tells `rustdoc` that the code should compile correctly, but not actually pass as a test. -```text +```rust /// ```no_run /// loop { /// println!("Hello, world"); From 6d521ecc62013efb62d541b783441c715e7a0e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Gerber?= Date: Sat, 14 Mar 2020 23:40:29 +0100 Subject: [PATCH 3/3] Fix punctuation in rustdoc book --- src/doc/rustdoc/src/advanced-features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/rustdoc/src/advanced-features.md b/src/doc/rustdoc/src/advanced-features.md index 47bef3cdde187..7c12d23e6495c 100644 --- a/src/doc/rustdoc/src/advanced-features.md +++ b/src/doc/rustdoc/src/advanced-features.md @@ -4,7 +4,7 @@ The features listed on this page fall outside the rest of the main categories. ## `#[cfg(doc)]`: Documenting platform-/feature-specific information -For conditional compilation, Rustdoc treats your crate the same way the compiler does: Only things +For conditional compilation, Rustdoc treats your crate the same way the compiler does. Only things from the host target are available (or from the given `--target` if present), and everything else is "filtered out" from the crate. This can cause problems if your crate is providing different things on different targets and you want your documentation to reflect all the available items you