diff --git a/src/doc/book b/src/doc/book index 614c19cb40256..9900d976bbfec 160000 --- a/src/doc/book +++ b/src/doc/book @@ -1 +1 @@ -Subproject commit 614c19cb4025636eb2ba68ebb3d44e3bd3a5e6e4 +Subproject commit 9900d976bbfecf4e8124da54351a9ad85ee3c7f3 diff --git a/src/tools/rustbook/Cargo.lock b/src/tools/rustbook/Cargo.lock index 400eb7c5e0d7b..024b8f9becb09 100644 --- a/src/tools/rustbook/Cargo.lock +++ b/src/tools/rustbook/Cargo.lock @@ -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" @@ -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", @@ -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" @@ -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]] @@ -1144,8 +1146,7 @@ dependencies = [ "mdbook", "mdbook-i18n-helpers", "mdbook-spec", - "mdbook-trpl-listing", - "mdbook-trpl-note", + "mdbook-trpl", ] [[package]] diff --git a/src/tools/rustbook/Cargo.toml b/src/tools/rustbook/Cargo.toml index 854c454733759..c2ce8fef4d0b8 100644 --- a/src/tools/rustbook/Cargo.toml +++ b/src/tools/rustbook/Cargo.toml @@ -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" } diff --git a/src/tools/rustbook/src/main.rs b/src/tools/rustbook/src/main.rs index a1ef18610b000..33f2a51215dfe 100644 --- a/src/tools/rustbook/src/main.rs +++ b/src/tools/rustbook/src/main.rs @@ -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!()); @@ -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() {