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

rustbook: update to use new mdbook-trpl package from The Book #133930

Merged
merged 1 commit into from
Dec 6, 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: 1 addition & 1 deletion src/doc/book
Submodule book updated 147 files
47 changes: 24 additions & 23 deletions src/tools/rustbook/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -709,30 +709,20 @@ dependencies = [
]

[[package]]
name = "mdbook-trpl-listing"
name = "mdbook-trpl"
version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"html_parser",
"mdbook",
"pulldown-cmark 0.10.3",
"pulldown-cmark-to-cmark 13.0.0",
"pulldown-cmark 0.12.2",
"pulldown-cmark-to-cmark 19.0.0",
"serde_json",
"thiserror",
"toml 0.8.19",
]

[[package]]
name = "mdbook-trpl-note"
version = "1.0.0"
dependencies = [
"clap",
"mdbook",
"pulldown-cmark 0.10.3",
"pulldown-cmark-to-cmark 13.0.0",
"serde_json",
]

[[package]]
name = "memchr"
version = "2.7.4"
Expand Down Expand Up @@ -1010,7 +1000,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993"
dependencies = [
"bitflags 2.6.0",
"getopts",
"memchr",
"pulldown-cmark-escape 0.10.1",
"unicase",
Expand All @@ -1028,6 +1017,19 @@ dependencies = [
"unicase",
]

[[package]]
name = "pulldown-cmark"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f86ba2052aebccc42cbbb3ed234b8b13ce76f75c3551a303cb2bcffcff12bb14"
dependencies = [
"bitflags 2.6.0",
"getopts",
"memchr",
"pulldown-cmark-escape 0.11.0",
"unicase",
]

[[package]]
name = "pulldown-cmark-escape"
version = "0.10.1"
Expand All @@ -1042,20 +1044,20 @@ checksum = "007d8adb5ddab6f8e3f491ac63566a7d5002cc7ed73901f72057943fa71ae1ae"

[[package]]
name = "pulldown-cmark-to-cmark"
version = "13.0.0"
version = "15.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f609795c8d835f79dcfcf768415b9fb57ef1b74891e99f86e73f43a7a257163b"
checksum = "b9c77db841443d89a57ae94f22d29c022f6d9f41b00bddbf1f4024dbaf4bdce1"
dependencies = [
"pulldown-cmark 0.10.3",
"pulldown-cmark 0.11.3",
]

[[package]]
name = "pulldown-cmark-to-cmark"
version = "15.0.1"
version = "19.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9c77db841443d89a57ae94f22d29c022f6d9f41b00bddbf1f4024dbaf4bdce1"
checksum = "7d742adcc7b655dba3e9ebab47954ca229fc0fa1df01fdc94349b6f3a2e6d257"
dependencies = [
"pulldown-cmark 0.11.3",
"pulldown-cmark 0.12.2",
]

[[package]]
Expand Down Expand Up @@ -1144,8 +1146,7 @@ dependencies = [
"mdbook",
"mdbook-i18n-helpers",
"mdbook-spec",
"mdbook-trpl-listing",
"mdbook-trpl-note",
"mdbook-trpl",
]

[[package]]
Expand Down
3 changes: 1 addition & 2 deletions src/tools/rustbook/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ edition = "2021"
[dependencies]
clap = "4.0.32"
env_logger = "0.11"
mdbook-trpl-listing = { path = "../../doc/book/packages/mdbook-trpl-listing" }
mdbook-trpl-note = { path = "../../doc/book/packages/mdbook-trpl-note" }
mdbook-trpl = { path = "../../doc/book/packages/mdbook-trpl" }
mdbook-i18n-helpers = "0.3.3"
mdbook-spec = { path = "../../doc/reference/mdbook-spec" }

Expand Down
11 changes: 7 additions & 4 deletions src/tools/rustbook/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use mdbook::MDBook;
use mdbook::errors::Result as Result3;
use mdbook_i18n_helpers::preprocessors::Gettext;
use mdbook_spec::Spec;
use mdbook_trpl_listing::TrplListing;
use mdbook_trpl_note::TrplNote;
use mdbook_trpl::{Figure, Listing, Note};

fn main() {
let crate_version = concat!("v", crate_version!());
Expand Down Expand Up @@ -109,11 +108,15 @@ pub fn build(args: &ArgMatches) -> Result3<()> {
// preprocessor, or this should modify the config and use
// MDBook::load_with_config.
if book.config.get_preprocessor("trpl-note").is_some() {
book.with_preprocessor(TrplNote);
book.with_preprocessor(Note);
}

if book.config.get_preprocessor("trpl-listing").is_some() {
book.with_preprocessor(TrplListing);
book.with_preprocessor(Listing);
}

if book.config.get_preprocessor("trpl-figure").is_some() {
book.with_preprocessor(Figure);
}

if book.config.get_preprocessor("spec").is_some() {
Expand Down
Loading