Skip to content

Commit

Permalink
All doctests in mdbook project now pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobhy committed Dec 17, 2024
1 parent b2eb96c commit 248f490
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
7 changes: 6 additions & 1 deletion guide/src/for_developers/preprocessors.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ translate events back into markdown text.
The following code block shows how to remove all emphasis from markdown,
without accidentally breaking the document.

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

Expand Down
9 changes: 5 additions & 4 deletions guide/src/format/mathjax.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,25 @@ extra backslash to work. Hopefully this limitation will be lifted soon.
> to add _two extra_ backslashes (e.g., `\begin{cases} \frac 1 2 \\\\ \frac 3 4
> \end{cases}`).

### Inline equations

Inline equations are delimited by `\\(` and `\\)`. So for example, to render the
following inline equation \\( \int x dx = \frac{x^2}{2} + C \\) you would write
the following:
```

```text
\\( \int x dx = \frac{x^2}{2} + C \\)
```

### Block equations

Block equations are delimited by `\\[` and `\\]`. To render the following
equation

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


you would write:

```bash
```text
\\[ \mu = \frac{1}{N} \sum_{i=0} x_i \\]
```
6 changes: 3 additions & 3 deletions guide/src/format/mdbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Rustdoc will use the complete example when you run `mdbook test`.

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

```rust
```rust,editable
fn main() {
let x = add_one(2);
assert_eq!(x, 3);
Expand Down Expand Up @@ -320,8 +320,8 @@ To configure this:

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`.
2. In your ***book.toml***:
* configure the path to ***Cargo.toml** in `rust.manifest`, as described in [rust configuration](/format/configuration/general.html#rust-options).
* remove `rust.edition` if it is configured. The edition of rust compiler will be as specified in the ***Cargo.toml***.
* configure the path to ***Cargo.toml*** in `rust.manifest`, as described in [rust configuration](/format/configuration/general.html#rust-options).
* 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).
* Refrain from invoking `mdbook test` with `-L` or `--library-path` argument. This, too, will be inferred from cargo project configuration

# Features for general content
Expand Down

0 comments on commit 248f490

Please sign in to comment.