Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a <Listing> preprocessor #3918

Merged
merged 8 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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