Skip to content

Commit 9c9104e

Browse files
ehusscarols10cents
authored andcommitted
Update to mdbook 0.5
Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-051 This also changes it so that it is not necessary to install `mbdook-trpl`. This should make it easier to work with the book and the extension.
1 parent 8c0eacd commit 9c9104e

File tree

20 files changed

+240
-586
lines changed

20 files changed

+240
-586
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: CI
22
on: [push, pull_request]
33

4+
env:
5+
MDBOOK_VERSION: 0.5.1
6+
47
jobs:
58
test:
69
name: Run tests
@@ -17,7 +20,7 @@ jobs:
1720
- name: Install mdbook
1821
run: |
1922
mkdir bin
20-
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.45/mdbook-v0.4.45-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
23+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
2124
echo "$(pwd)/bin" >> "${GITHUB_PATH}"
2225
- name: Report versions
2326
run: |
@@ -71,10 +74,8 @@ jobs:
7174
- name: Install mdbook
7275
run: |
7376
mkdir bin
74-
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.45/mdbook-v0.4.45-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
77+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
7578
echo "$(pwd)/bin" >> "${GITHUB_PATH}"
76-
- name: Install mdbook-trpl binaries
77-
run: cargo install --path packages/mdbook-trpl
7879
- name: Install aspell
7980
run: sudo apt-get install aspell
8081
- name: Install shellcheck

2018-edition/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[book]
22
title = "The Rust Programming Language"
3-
author = "Steve Klabnik and Carol Nichols, with Contributions from the Rust Community"
3+
authors = ["Steve Klabnik", "Carol Nichols", "Contributions from the Rust Community"]
44

55
[output.html]
66
additional-css = ["ferris.css"]

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ rust-lang/rust uses in [this file][rust-mdbook]. To get it:
3333
$ cargo install mdbook --locked --version <version_num>
3434
```
3535

36-
The book also uses two mdbook plugins which are part of this repository. If you
37-
do not install them, you will see warnings when building and the output will not
38-
look right, but you _will_ still be able to build the book. To use the plugins,
39-
you should run:
40-
41-
```bash
42-
$ cargo install --locked --path packages/mdbook-trpl --force
43-
```
44-
4536
## Building
4637

4738
To build the book, type:

book.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,14 @@ use-boolean-and = true
3939

4040
# Do not sync this preprocessor; it is for the HTML renderer only.
4141
[preprocessor.trpl-note]
42+
command = "cargo run --manifest-path packages/mdbook-trpl/Cargo.toml --bin mdbook-trpl-note"
4243

4344
[preprocessor.trpl-listing]
45+
command = "cargo run --manifest-path packages/mdbook-trpl/Cargo.toml --bin mdbook-trpl-listing"
4446
output-mode = "default"
4547

4648
[rust]
4749
edition = "2024"
50+
51+
[build]
52+
extra-watch-dirs = ["packages/mdbook-trpl"]

first-edition/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[book]
22
title = "The Rust Programming Language"
3-
author = "The Rust Project Developers"
3+
authors = ["The Rust Project Developers"]

nostarch/book.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ git-repository-url = "https://github.com/rust-lang/book"
1212
build-dir = "../tmp"
1313

1414
[preprocessor.trpl-listing]
15+
command = "cargo run --manifest-path ../packages/mdbook-trpl/Cargo.toml --bin mdbook-trpl-listing"
1516
output-mode = "simple"
1617

1718
# Only used in this version, *not* in the root `book.toml`, because its job is
1819
# to remove `<figure>` and `<figcaption>` markup from the version we send them.
1920
[preprocessor.trpl-figure]
21+
command = "cargo run --manifest-path ../packages/mdbook-trpl/Cargo.toml --bin mdbook-trpl-figure"
2022
output-mode = "simple"
2123

2224
[preprocessor.trpl-heading]
25+
command = "cargo run --manifest-path ../packages/mdbook-trpl/Cargo.toml --bin mdbook-trpl-heading"
2326
output-mode = "simple"
2427

2528
[rust]

0 commit comments

Comments
 (0)