about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-03-16 01:30:41 +0100
committerGitHub <noreply@github.com>2020-03-16 01:30:41 +0100
commit6b50a4cebb55db54104a071c74f2fc74de17b6af (patch)
treee672e08f84632cbef14a7aec025e360f907b4f2c /src
parent9296d770bd7fd5325280da86ab0c06562aa52c2d (diff)
parent6d521ecc62013efb62d541b783441c715e7a0e74 (diff)
downloadrust-6b50a4cebb55db54104a071c74f2fc74de17b6af.tar.gz
rust-6b50a4cebb55db54104a071c74f2fc74de17b6af.zip
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!
Diffstat (limited to 'src')
-rw-r--r--src/doc/rustdoc/src/advanced-features.md2
-rw-r--r--src/doc/rustdoc/src/command-line-arguments.md4
-rw-r--r--src/doc/rustdoc/src/documentation-tests.md2
-rw-r--r--src/doc/rustdoc/src/what-is-rustdoc.md6
4 files changed, 7 insertions, 7 deletions
diff --git a/src/doc/rustdoc/src/advanced-features.md b/src/doc/rustdoc/src/advanced-features.md
index 47bef3cdde1..7c12d23e649 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
diff --git a/src/doc/rustdoc/src/command-line-arguments.md b/src/doc/rustdoc/src/command-line-arguments.md
index 2e32ce31eca..ddbe26389fd 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/documentation-tests.md b/src/doc/rustdoc/src/documentation-tests.md
index 96fa4344b04..78181156e25 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");
diff --git a/src/doc/rustdoc/src/what-is-rustdoc.md b/src/doc/rustdoc/src/what-is-rustdoc.md
index bbcacb7f3d5..adcebc832bc 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 <path>\docs\target\doc -L
-dependency=<path>docs\target\debug\deps
+$ rustdoc --crate-name docs src/lib.rs -o <path>/docs/target/doc -L
+dependency=<path>/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.