Skip to content

Commit 904adfa

Browse files
committed
docs: migrate to mdBook 0.5.
1 parent 9315b62 commit 904adfa

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

docgen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ unnamed_entity.workspace = true
2424
clap.workspace = true
2525
indexmap.workspace = true
2626
itertools.workspace = true
27-
mdbook = { version = "0.4.47", default-features = false }
27+
mdbook-preprocessor = { version = "0.5", default-features = false }
2828
serde_json = "1.0.96"
2929
semver = "1.0.17"
3030

docgen/src/main.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ use std::{
55

66
use clap::{Arg, ArgMatches, Command};
77
use coolrunner2::gen_coolrunner2;
8-
use mdbook::{
9-
BookItem,
10-
book::{Book, Chapter},
8+
use mdbook_preprocessor::{
9+
Preprocessor, PreprocessorContext,
10+
book::{Book, BookItem, Chapter},
1111
errors::{Error, Result},
12-
preprocess::{CmdPreprocessor, Preprocessor, PreprocessorContext},
1312
};
1413
use semver::{Version, VersionReq};
1514
use siliconblue::gen_siliconblue;
@@ -62,17 +61,17 @@ fn main() {
6261
}
6362

6463
fn handle_preprocessing(pre: &dyn Preprocessor) -> Result<(), Error> {
65-
let (ctx, book) = CmdPreprocessor::parse_input(io::stdin())?;
64+
let (ctx, book) = mdbook_preprocessor::parse_input(io::stdin())?;
6665

6766
let book_version = Version::parse(&ctx.mdbook_version)?;
68-
let version_req = VersionReq::parse(mdbook::MDBOOK_VERSION)?;
67+
let version_req = VersionReq::parse(mdbook_preprocessor::MDBOOK_VERSION)?;
6968

7069
if !version_req.matches(&book_version) {
7170
eprintln!(
7271
"Warning: The {} plugin was built against version {} of mdbook, \
7372
but we're being called from version {}",
7473
pre.name(),
75-
mdbook::MDBOOK_VERSION,
74+
mdbook_preprocessor::MDBOOK_VERSION,
7675
ctx.mdbook_version
7776
);
7877
}
@@ -87,7 +86,7 @@ fn handle_supports(pre: &dyn Preprocessor, sub_args: &ArgMatches) -> ! {
8786
let renderer = sub_args
8887
.get_one::<String>("renderer")
8988
.expect("Required argument");
90-
let supported = pre.supports_renderer(renderer);
89+
let supported = pre.supports_renderer(renderer).unwrap();
9190

9291
// Signal whether the renderer is supported by exiting with 1 or 0.
9392
if supported {

docs/book.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[book]
22
authors = ["Wanda"]
33
language = "en"
4-
multilingual = false
54
src = "src"
65
title = "Project Combine"
76

7+
[build]
8+
extra-watch-dirs = ["../databases"]
9+
810
[preprocessor.prjcombine-docgen]
911
command = "cargo run -q --bin prjcombine-docgen --"
1012
after = ["index"]
@@ -20,4 +22,4 @@ enable = false
2022

2123
[output.html.fold]
2224
enable = true
23-
depth = 1
25+
level = 1

0 commit comments

Comments
 (0)