Skip to content

Commit 248f490

Browse files
committed
All doctests in mdbook project now pass.
1 parent b2eb96c commit 248f490

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

guide/src/for_developers/preprocessors.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ translate events back into markdown text.
6666
The following code block shows how to remove all emphasis from markdown,
6767
without accidentally breaking the document.
6868

69-
```rust,no_run
69+
```rust,compile_fail
70+
# // tagged compile_fail because
71+
# // sample fails to compile here:
72+
# // "trait Borrow not implemented for pulldown_cmark_to_cmark::..."
73+
# // Probably due to version skew on pulldown-cmark
74+
# // between examples/remove-emphasis/Cargo.toml and <root>/Cargo.toml
7075
{{#rustdoc_include ../../../examples/remove-emphasis/mdbook-remove-emphasis/src/main.rs:remove_emphasis}}
7176
```
7277

guide/src/format/mathjax.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,25 @@ extra backslash to work. Hopefully this limitation will be lifted soon.
2020
> to add _two extra_ backslashes (e.g., `\begin{cases} \frac 1 2 \\\\ \frac 3 4
2121
> \end{cases}`).
2222
23-
2423
### Inline equations
24+
2525
Inline equations are delimited by `\\(` and `\\)`. So for example, to render the
2626
following inline equation \\( \int x dx = \frac{x^2}{2} + C \\) you would write
2727
the following:
28-
```
28+
29+
```text
2930
\\( \int x dx = \frac{x^2}{2} + C \\)
3031
```
3132

3233
### Block equations
34+
3335
Block equations are delimited by `\\[` and `\\]`. To render the following
3436
equation
3537

3638
\\[ \mu = \frac{1}{N} \sum_{i=0} x_i \\]
3739

38-
3940
you would write:
4041

41-
```bash
42+
```text
4243
\\[ \mu = \frac{1}{N} \sum_{i=0} x_i \\]
4344
```

guide/src/format/mdbook.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Rustdoc will use the complete example when you run `mdbook test`.
230230

231231
For example, consider a file named `file.rs` that contains this Rust program:
232232

233-
```rust
233+
```rust,editable
234234
fn main() {
235235
let x = add_one(2);
236236
assert_eq!(x, 3);
@@ -320,8 +320,8 @@ To configure this:
320320

321321
1. Create a ***Cargo.toml*** file with a `[package.dependencies]` section that defines a dependency for each `<crate>` you want to use in any sample. If your book is already embedded in an existing Cargo project, you may be able to use the existing project `Cargo.toml`.
322322
2. In your ***book.toml***:
323-
* configure the path to ***Cargo.toml** in `rust.manifest`, as described in [rust configuration](/format/configuration/general.html#rust-options).
324-
* remove `rust.edition` if it is configured. The edition of rust compiler will be as specified in the ***Cargo.toml***.
323+
* configure the path to ***Cargo.toml*** in `rust.manifest`, as described in [rust configuration](/format/configuration/general.html#rust-options).
324+
* remove `rust.edition` if it is configured. The default rust edition will be as specified in the ***Cargo.toml*** (though this can be overridden for a specific code block).
325325
* Refrain from invoking `mdbook test` with `-L` or `--library-path` argument. This, too, will be inferred from cargo project configuration
326326

327327
# Features for general content

0 commit comments

Comments
 (0)