Skip to content

Commit 38ddb44

Browse files
committed
Check for deadlinks from the summary during book generation
Previously, any deadlinks from a book's SUMMARY.md wouldn't cause any errors or warnings or similar but mdbook would simply create a page with blank content. This has kept bug #47394 hidden. It should have been detected back in the PR when those wrongly named files got added to the book. PR #47414 was one component of the solution. This change is a second line of defense for the unstable book and a first line of defense for any other book. We also update mdbook to the most recent version.
1 parent 57850e5 commit 38ddb44

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/Cargo.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tools/rustbook/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ license = "MIT/Apache-2.0"
88
clap = "2.25.0"
99

1010
[dependencies.mdbook]
11-
version = "0.0.26"
11+
version = "0.0.28"
1212
default-features = false

src/tools/rustbook/src/main.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ fn main() {
5252
// Build command implementation
5353
pub fn build(args: &ArgMatches) -> Result<()> {
5454
let book_dir = get_book_dir(args);
55-
let book = MDBook::new(&book_dir).read_config()?;
55+
let mut book = MDBook::new(&book_dir).read_config()?;
5656

57-
let mut book = match args.value_of("dest-dir") {
58-
Some(dest_dir) => book.with_destination(dest_dir),
59-
None => book,
60-
};
57+
// Set this to allow us to catch bugs in advance.
58+
book.config.build.create_missing = false;
59+
60+
if let Some(dest_dir) = args.value_of("dest-dir") {
61+
book.config.build.build_dir = PathBuf::from(dest_dir);
62+
}
6163

6264
book.build()?;
6365

0 commit comments

Comments
 (0)