Skip to content

Commit 026d21d

Browse files
authored
Rollup merge of rust-lang#133930 - chriskrycho:mdbook-trpl-package, r=ehuss
rustbook: update to use new mdbook-trpl package from The Book Updates to the latest merge from `rust-lang/book` and simplifies the dependency chain there. There are now three preprocessors, but only one package, so everything is a lot nicer to deal with from the consuming POV (i.e. here).
2 parents b780404 + 74756c1 commit 026d21d

File tree

4 files changed

+33
-30
lines changed

4 files changed

+33
-30
lines changed

Diff for: src/doc/book

Submodule book updated 147 files

Diff for: src/tools/rustbook/Cargo.lock

+24-23
Original file line numberDiff line numberDiff line change
@@ -709,30 +709,20 @@ dependencies = [
709709
]
710710

711711
[[package]]
712-
name = "mdbook-trpl-listing"
712+
name = "mdbook-trpl"
713713
version = "0.1.0"
714714
dependencies = [
715+
"anyhow",
715716
"clap",
716717
"html_parser",
717718
"mdbook",
718-
"pulldown-cmark 0.10.3",
719-
"pulldown-cmark-to-cmark 13.0.0",
719+
"pulldown-cmark 0.12.2",
720+
"pulldown-cmark-to-cmark 19.0.0",
720721
"serde_json",
721722
"thiserror",
722723
"toml 0.8.19",
723724
]
724725

725-
[[package]]
726-
name = "mdbook-trpl-note"
727-
version = "1.0.0"
728-
dependencies = [
729-
"clap",
730-
"mdbook",
731-
"pulldown-cmark 0.10.3",
732-
"pulldown-cmark-to-cmark 13.0.0",
733-
"serde_json",
734-
]
735-
736726
[[package]]
737727
name = "memchr"
738728
version = "2.7.4"
@@ -1010,7 +1000,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
10101000
checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993"
10111001
dependencies = [
10121002
"bitflags 2.6.0",
1013-
"getopts",
10141003
"memchr",
10151004
"pulldown-cmark-escape 0.10.1",
10161005
"unicase",
@@ -1028,6 +1017,19 @@ dependencies = [
10281017
"unicase",
10291018
]
10301019

1020+
[[package]]
1021+
name = "pulldown-cmark"
1022+
version = "0.12.2"
1023+
source = "registry+https://github.com/rust-lang/crates.io-index"
1024+
checksum = "f86ba2052aebccc42cbbb3ed234b8b13ce76f75c3551a303cb2bcffcff12bb14"
1025+
dependencies = [
1026+
"bitflags 2.6.0",
1027+
"getopts",
1028+
"memchr",
1029+
"pulldown-cmark-escape 0.11.0",
1030+
"unicase",
1031+
]
1032+
10311033
[[package]]
10321034
name = "pulldown-cmark-escape"
10331035
version = "0.10.1"
@@ -1042,20 +1044,20 @@ checksum = "007d8adb5ddab6f8e3f491ac63566a7d5002cc7ed73901f72057943fa71ae1ae"
10421044

10431045
[[package]]
10441046
name = "pulldown-cmark-to-cmark"
1045-
version = "13.0.0"
1047+
version = "15.0.1"
10461048
source = "registry+https://github.com/rust-lang/crates.io-index"
1047-
checksum = "f609795c8d835f79dcfcf768415b9fb57ef1b74891e99f86e73f43a7a257163b"
1049+
checksum = "b9c77db841443d89a57ae94f22d29c022f6d9f41b00bddbf1f4024dbaf4bdce1"
10481050
dependencies = [
1049-
"pulldown-cmark 0.10.3",
1051+
"pulldown-cmark 0.11.3",
10501052
]
10511053

10521054
[[package]]
10531055
name = "pulldown-cmark-to-cmark"
1054-
version = "15.0.1"
1056+
version = "19.0.0"
10551057
source = "registry+https://github.com/rust-lang/crates.io-index"
1056-
checksum = "b9c77db841443d89a57ae94f22d29c022f6d9f41b00bddbf1f4024dbaf4bdce1"
1058+
checksum = "7d742adcc7b655dba3e9ebab47954ca229fc0fa1df01fdc94349b6f3a2e6d257"
10571059
dependencies = [
1058-
"pulldown-cmark 0.11.3",
1060+
"pulldown-cmark 0.12.2",
10591061
]
10601062

10611063
[[package]]
@@ -1144,8 +1146,7 @@ dependencies = [
11441146
"mdbook",
11451147
"mdbook-i18n-helpers",
11461148
"mdbook-spec",
1147-
"mdbook-trpl-listing",
1148-
"mdbook-trpl-note",
1149+
"mdbook-trpl",
11491150
]
11501151

11511152
[[package]]

Diff for: src/tools/rustbook/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ edition = "2021"
99
[dependencies]
1010
clap = "4.0.32"
1111
env_logger = "0.11"
12-
mdbook-trpl-listing = { path = "../../doc/book/packages/mdbook-trpl-listing" }
13-
mdbook-trpl-note = { path = "../../doc/book/packages/mdbook-trpl-note" }
12+
mdbook-trpl = { path = "../../doc/book/packages/mdbook-trpl" }
1413
mdbook-i18n-helpers = "0.3.3"
1514
mdbook-spec = { path = "../../doc/reference/mdbook-spec" }
1615

Diff for: src/tools/rustbook/src/main.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ use mdbook::MDBook;
66
use mdbook::errors::Result as Result3;
77
use mdbook_i18n_helpers::preprocessors::Gettext;
88
use mdbook_spec::Spec;
9-
use mdbook_trpl_listing::TrplListing;
10-
use mdbook_trpl_note::TrplNote;
9+
use mdbook_trpl::{Figure, Listing, Note};
1110

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

115114
if book.config.get_preprocessor("trpl-listing").is_some() {
116-
book.with_preprocessor(TrplListing);
115+
book.with_preprocessor(Listing);
116+
}
117+
118+
if book.config.get_preprocessor("trpl-figure").is_some() {
119+
book.with_preprocessor(Figure);
117120
}
118121

119122
if book.config.get_preprocessor("spec").is_some() {

0 commit comments

Comments
 (0)