Skip to content

Commit

Permalink
Merge pull request #3918 from rust-lang/trpl-listing
Browse files Browse the repository at this point in the history
Add a `<Listing>` preprocessor
  • Loading branch information
chriskrycho authored May 14, 2024
2 parents 03178db + 17c244a commit 444932b
Show file tree
Hide file tree
Showing 12 changed files with 894 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
echo "$(pwd)/bin" >> ${GITHUB_PATH}
- name: Install mdbook-trpl-note
run: cargo install --path packages/mdbook-trpl-note
- name: Install mdbook-trpl-listing
run: cargo install --path packages/mdbook-trpl-listing
- name: Install aspell
run: sudo apt-get install aspell
- name: Install shellcheck
Expand Down
87 changes: 80 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ exclude = [
]

[workspace.dependencies]
assert_cmd = "2.0.14"
walkdir = "2.3.1"
clap = { version = "4.5.4", features = ["derive"] }
docopt = "1.1.0"
mdbook = "0.4.37"
pulldown-cmark = { version = "0.10.3", features = ["simd"] }
pulldown-cmark-to-cmark = "13.0.0"
serde = "1.0"
serde_json = "1.0"
regex = "1.3.3"
lazy_static = "1.4.0"
flate2 = "1.0.13"
Expand Down
5 changes: 4 additions & 1 deletion book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ title = "The Rust Programming Language"
authors = ["Steve Klabnik", "Carol Nichols", "Contributions from the Rust Community"]

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

# Do not sync this preprocessor; it is for the HTML renderer only.
[preprocessor.trpl-note]

[preprocessor.trpl-listing]
output-mode = "default"
5 changes: 4 additions & 1 deletion nostarch/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ additional-js = ["../ferris.js"]
git-repository-url = "https://github.com/rust-lang/book"

[build]
build-dir = "../tmp"
build-dir = "../tmp"

[preprocessor.trpl-listing]
output-mode = "simple"
19 changes: 19 additions & 0 deletions packages/mdbook-trpl-listing/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "mdbook-trpl-listing"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { workspace = true }
mdbook = { workspace = true }
pulldown-cmark = { workspace = true }
pulldown-cmark-to-cmark = { workspace = true }
serde_json = { workspace = true }
thiserror = "1.0.60"
toml = "0.8.12"
xmlparser = "0.13.6"

[dev-dependencies]
assert_cmd = { workspace = true }
Loading

0 comments on commit 444932b

Please sign in to comment.