Skip to content

Commit 444932b

Browse files
authored
Merge pull request #3918 from rust-lang/trpl-listing
Add a `<Listing>` preprocessor
2 parents 03178db + 17c244a commit 444932b

File tree

12 files changed

+894
-16
lines changed

12 files changed

+894
-16
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ jobs:
6060
echo "$(pwd)/bin" >> ${GITHUB_PATH}
6161
- name: Install mdbook-trpl-note
6262
run: cargo install --path packages/mdbook-trpl-note
63+
- name: Install mdbook-trpl-listing
64+
run: cargo install --path packages/mdbook-trpl-listing
6365
- name: Install aspell
6466
run: sudo apt-get install aspell
6567
- name: Install shellcheck

Cargo.lock

Lines changed: 80 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ exclude = [
88
]
99

1010
[workspace.dependencies]
11+
assert_cmd = "2.0.14"
1112
walkdir = "2.3.1"
13+
clap = { version = "4.5.4", features = ["derive"] }
1214
docopt = "1.1.0"
1315
mdbook = "0.4.37"
16+
pulldown-cmark = { version = "0.10.3", features = ["simd"] }
17+
pulldown-cmark-to-cmark = "13.0.0"
1418
serde = "1.0"
19+
serde_json = "1.0"
1520
regex = "1.3.3"
1621
lazy_static = "1.4.0"
1722
flate2 = "1.0.13"

book.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ title = "The Rust Programming Language"
66
authors = ["Steve Klabnik", "Carol Nichols", "Contributions from the Rust Community"]
77

88
[output.html]
9-
additional-css = ["ferris.css", "theme/2018-edition.css", "theme/semantic-notes.css"]
9+
additional-css = ["ferris.css", "theme/2018-edition.css", "theme/semantic-notes.css", "theme/listing.css"]
1010
additional-js = ["ferris.js"]
1111
git-repository-url = "https://github.com/rust-lang/book"
1212

1313
# Do not sync this preprocessor; it is for the HTML renderer only.
1414
[preprocessor.trpl-note]
15+
16+
[preprocessor.trpl-listing]
17+
output-mode = "default"

nostarch/book.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ additional-js = ["../ferris.js"]
99
git-repository-url = "https://github.com/rust-lang/book"
1010

1111
[build]
12-
build-dir = "../tmp"
12+
build-dir = "../tmp"
13+
14+
[preprocessor.trpl-listing]
15+
output-mode = "simple"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "mdbook-trpl-listing"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
9+
clap = { workspace = true }
10+
mdbook = { workspace = true }
11+
pulldown-cmark = { workspace = true }
12+
pulldown-cmark-to-cmark = { workspace = true }
13+
serde_json = { workspace = true }
14+
thiserror = "1.0.60"
15+
toml = "0.8.12"
16+
xmlparser = "0.13.6"
17+
18+
[dev-dependencies]
19+
assert_cmd = { workspace = true }

0 commit comments

Comments
 (0)