diff --git a/src/book/mod.rs b/src/book/mod.rs index 8a7a93f4..d1ed19c4 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -213,12 +213,13 @@ impl MDBook { .flat_map(|x| vec![x.0, x.1]) .collect(); - let temp_dir = TempFileBuilder::new().prefix("mdbook").tempdir()?; + let temp_dir = TempFileBuilder::new().prefix("mdbook-").tempdir()?; let preprocess_context = PreprocessorContext::new(self.root.clone(), self.config.clone()); LinkPreprocessor::new().run(&preprocess_context, &mut self.book)?; - IndexPreprocessor::new().run(&preprocess_context, &mut self.book)?; + // Index Preprocessor is disabled so that chapter paths continue to point to the + // actual markdown files. for item in self.iter() { if let BookItem::Chapter(ref ch) = *item { diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index df126fd1..c5b6730f 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -1,4 +1,4 @@ -/// Subcommand modules for the `mdbook` binary. +//! Subcommand modules for the `mdbook` binary. pub mod build; pub mod clean; diff --git a/src/cmd/serve.rs b/src/cmd/serve.rs index aab58a8f..22aa3ab9 100644 --- a/src/cmd/serve.rs +++ b/src/cmd/serve.rs @@ -5,13 +5,13 @@ extern crate ws; use self::iron::{ status, AfterMiddleware, Chain, Iron, IronError, IronResult, Request, Response, Set, }; +#[cfg(feature = "watch")] +use super::watch; use clap::{App, ArgMatches, SubCommand}; use mdbook::errors::*; use mdbook::utils; use mdbook::MDBook; use std; -#[cfg(feature = "watch")] -use super::watch; use {get_book_dir, open}; struct ErrorRecover; diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index 8949c393..2367446f 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -370,7 +370,8 @@ impl Renderer for HtmlHandlebars { .chain_err(|| "Unable to copy across additional CSS and JS")?; // Render search index - #[cfg(feature = "search")] { + #[cfg(feature = "search")] + { let search = html_config.search.unwrap_or_default(); if search.enable { super::search::create_files(&search, &destination, &book)?; diff --git a/tests/dummy_book/mod.rs b/tests/dummy_book/mod.rs index 4c904132..4fe24455 100644 --- a/tests/dummy_book/mod.rs +++ b/tests/dummy_book/mod.rs @@ -47,7 +47,7 @@ impl DummyBook { /// Write a book to a temporary directory using the provided settings. pub fn build(&self) -> Result { let temp = TempFileBuilder::new() - .prefix("dummy_book") + .prefix("dummy_book-") .tempdir() .chain_err(|| "Unable to create temp directory")?; diff --git a/tests/dummy_book/src/README.md b/tests/dummy_book/src/README.md new file mode 100644 index 00000000..7d946e35 --- /dev/null +++ b/tests/dummy_book/src/README.md @@ -0,0 +1,5 @@ +# Dummy Book + +This file is just here to cause the index preprocessor to run. + +Does a pretty good job, too. \ No newline at end of file diff --git a/tests/dummy_book/src/SUMMARY.md b/tests/dummy_book/src/SUMMARY.md index ccf3401a..0536e5c2 100644 --- a/tests/dummy_book/src/SUMMARY.md +++ b/tests/dummy_book/src/SUMMARY.md @@ -1,5 +1,6 @@ # Summary +[Dummy Book](README.md) [Introduction](intro.md) - [First Chapter](first/index.md) diff --git a/tests/rendered_output.rs b/tests/rendered_output.rs index cc22512d..c20b454e 100644 --- a/tests/rendered_output.rs +++ b/tests/rendered_output.rs @@ -27,6 +27,7 @@ const TOC_TOP_LEVEL: &[&'static str] = &[ "1. First Chapter", "2. Second Chapter", "Conclusion", + "Dummy Book", "Introduction", ]; const TOC_SECOND_LEVEL: &[&'static str] = @@ -126,7 +127,8 @@ fn rendered_code_has_playpen_stuff() { #[test] fn chapter_content_appears_in_rendered_document() { let content = vec![ - ("index.html", "Here's some interesting text"), + ("index.html", "This file is just here to cause the"), + ("intro.html", "Here's some interesting text"), ("second.html", "Second Chapter"), ("first/nested.html", "testable code"), ("first/index.html", "more text"), @@ -437,7 +439,7 @@ mod search { assert_eq!(docs[&some_section]["body"], ""); assert_eq!( docs[&summary]["body"], - "Introduction First Chapter Nested Chapter Includes Recursive Second Chapter Conclusion" + "Dummy Book Introduction First Chapter Nested Chapter Includes Recursive Second Chapter Conclusion" ); assert_eq!(docs[&summary]["breadcrumbs"], "First Chapter » Summary"); assert_eq!(docs[&conclusion]["body"], "I put <HTML> in here!"); diff --git a/tests/searchindex_fixture.json b/tests/searchindex_fixture.json index 8e2f082e..330bc648 100644 --- a/tests/searchindex_fixture.json +++ b/tests/searchindex_fixture.json @@ -1,5 +1,6 @@ { "doc_urls": [ + "index.html#dummy-book", "intro.html#introduction", "first/index.html#first-chapter", "first/index.html#some-section", @@ -14,46 +15,51 @@ "documentStore": { "docInfo": { "0": { + "body": 9, + "breadcrumbs": 2, + "title": 2 + }, + "1": { "body": 3, "breadcrumbs": 1, "title": 1 }, - "1": { + "2": { "body": 2, "breadcrumbs": 2, "title": 2 }, - "2": { + "3": { "body": 0, "breadcrumbs": 1, "title": 1 }, - "3": { + "4": { "body": 4, "breadcrumbs": 4, "title": 2 }, - "4": { - "body": 0, - "breadcrumbs": 3, - "title": 1 - }, "5": { "body": 0, "breadcrumbs": 3, "title": 1 }, "6": { - "body": 10, + "body": 0, "breadcrumbs": 3, "title": 1 }, "7": { + "body": 12, + "breadcrumbs": 3, + "title": 1 + }, + "8": { "body": 20, "breadcrumbs": 2, "title": 2 }, - "8": { + "9": { "body": 3, "breadcrumbs": 1, "title": 1 @@ -61,61 +67,67 @@ }, "docs": { "0": { - "body": "Here's some interesting text...", - "breadcrumbs": "Introduction", + "body": "This file is just here to cause the index preprocessor to run. Does a pretty good job, too.", + "breadcrumbs": "Dummy Book", "id": "0", - "title": "Introduction" + "title": "Dummy Book" }, "1": { - "body": "more text.", - "breadcrumbs": "First Chapter", + "body": "Here's some interesting text...", + "breadcrumbs": "Introduction", "id": "1", - "title": "First Chapter" + "title": "Introduction" }, "2": { - "body": "", - "breadcrumbs": "Some Section", + "body": "more text.", + "breadcrumbs": "First Chapter", "id": "2", - "title": "Some Section" + "title": "First Chapter" }, "3": { - "body": "This file has some testable code. assert!(true);", - "breadcrumbs": "First Chapter » Nested Chapter", + "body": "", + "breadcrumbs": "Some Section", "id": "3", - "title": "Nested Chapter" + "title": "Some Section" }, "4": { - "body": "", - "breadcrumbs": "First Chapter » Some Section", + "body": "This file has some testable code. assert!(true);", + "breadcrumbs": "First Chapter » Nested Chapter", "id": "4", - "title": "Some Section" + "title": "Nested Chapter" }, "5": { "body": "", - "breadcrumbs": "First Chapter » Includes", + "breadcrumbs": "First Chapter » Some Section", "id": "5", - "title": "Includes" + "title": "Some Section" }, "6": { - "body": "Introduction First Chapter Nested Chapter Includes Recursive Second Chapter Conclusion", - "breadcrumbs": "First Chapter » Summary", + "body": "", + "breadcrumbs": "First Chapter » Includes", "id": "6", - "title": "Summary" + "title": "Includes" }, "7": { - "body": "This makes sure you can insert runnable Rust files. fn main() { println!(\"Hello World!\");\n#\n# // You can even hide lines! :D\n# println!(\"I am hidden! Expand the code snippet to see me\");\n}", - "breadcrumbs": "Second Chapter", + "body": "Dummy Book Introduction First Chapter Nested Chapter Includes Recursive Second Chapter Conclusion", + "breadcrumbs": "First Chapter » Summary", "id": "7", - "title": "Second Chapter" + "title": "Summary" }, "8": { + "body": "This makes sure you can insert runnable Rust files. fn main() { println!(\"Hello World!\");\n#\n# // You can even hide lines! :D\n# println!(\"I am hidden! Expand the code snippet to see me\");\n}", + "breadcrumbs": "Second Chapter", + "id": "8", + "title": "Second Chapter" + }, + "9": { "body": "I put <HTML> in here!", "breadcrumbs": "Conclusion", - "id": "8", + "id": "9", "title": "Conclusion" } }, - "length": 9, + "length": 10, "save": true }, "fields": [ @@ -155,7 +167,7 @@ "u": { "df": 1, "docs": { - "3": { + "4": { "tf": 1.0 } } @@ -174,7 +186,46 @@ } } }, + "b": { + "df": 0, + "docs": {}, + "o": { + "df": 0, + "docs": {}, + "o": { + "df": 0, + "docs": {}, + "k": { + "df": 2, + "docs": { + "0": { + "tf": 1.0 + }, + "7": { + "tf": 1.0 + } + } + } + } + } + }, "c": { + "a": { + "df": 0, + "docs": {}, + "u": { + "df": 0, + "docs": {}, + "s": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + } + } + }, "df": 0, "docs": {}, "h": { @@ -193,16 +244,16 @@ "r": { "df": 4, "docs": { - "1": { + "2": { "tf": 1.0 }, - "3": { + "4": { "tf": 1.0 }, - "6": { - "tf": 1.7320508075688773 - }, "7": { + "tf": 1.7320508075688773 + }, + "8": { "tf": 1.0 } } @@ -221,10 +272,10 @@ "e": { "df": 2, "docs": { - "3": { + "4": { "tf": 1.0 }, - "7": { + "8": { "tf": 1.0 } } @@ -245,10 +296,10 @@ "s": { "df": 2, "docs": { - "6": { + "7": { "tf": 1.0 }, - "8": { + "9": { "tf": 1.0 } } @@ -264,9 +315,32 @@ "d": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } + }, + "u": { + "df": 0, + "docs": {}, + "m": { + "df": 0, + "docs": {}, + "m": { + "df": 0, + "docs": {}, + "i": { + "df": 2, + "docs": { + "0": { + "tf": 1.0 + }, + "7": { + "tf": 1.0 + } + } + } + } + } } }, "df": 0, @@ -283,7 +357,7 @@ "n": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -301,7 +375,7 @@ "d": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -325,12 +399,15 @@ "df": 0, "docs": {}, "e": { - "df": 2, + "df": 3, "docs": { - "3": { + "0": { "tf": 1.0 }, - "7": { + "4": { + "tf": 1.0 + }, + "8": { "tf": 1.0 } } @@ -345,10 +422,10 @@ "t": { "df": 2, "docs": { - "1": { + "2": { "tf": 1.0 }, - "6": { + "7": { "tf": 1.0 } } @@ -359,12 +436,32 @@ "n": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } } }, + "g": { + "df": 0, + "docs": {}, + "o": { + "df": 0, + "docs": {}, + "o": { + "d": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + }, + "df": 0, + "docs": {} + } + } + }, "h": { "df": 0, "docs": {}, @@ -378,14 +475,17 @@ "'": { "df": 1, "docs": { - "0": { + "1": { "tf": 1.0 } } }, - "df": 1, + "df": 2, "docs": { - "8": { + "0": { + "tf": 1.0 + }, + "9": { "tf": 1.0 } } @@ -403,7 +503,7 @@ "n": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -415,7 +515,7 @@ "e": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -439,10 +539,10 @@ "d": { "df": 2, "docs": { - "5": { + "6": { "tf": 1.0 }, - "6": { + "7": { "tf": 1.0 } } @@ -452,6 +552,22 @@ } } }, + "d": { + "df": 0, + "docs": {}, + "e": { + "df": 0, + "docs": {}, + "x": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + } + } + }, "df": 0, "docs": {}, "s": { @@ -466,7 +582,7 @@ "t": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -492,7 +608,7 @@ "t": { "df": 1, "docs": { - "0": { + "1": { "tf": 1.0 } } @@ -515,10 +631,10 @@ "t": { "df": 2, "docs": { - "0": { + "1": { "tf": 1.0 }, - "6": { + "7": { "tf": 1.0 } } @@ -535,6 +651,22 @@ } } }, + "j": { + "df": 0, + "docs": {}, + "o": { + "b": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + }, + "df": 0, + "docs": {} + } + }, "l": { "df": 0, "docs": {}, @@ -547,7 +679,7 @@ "e": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -577,7 +709,7 @@ "t": { "df": 1, "docs": { - "8": { + "9": { "tf": 1.0 } } @@ -605,7 +737,7 @@ "n": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -617,7 +749,7 @@ "e": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -635,7 +767,7 @@ "e": { "df": 1, "docs": { - "1": { + "2": { "tf": 1.0 } } @@ -655,10 +787,10 @@ "t": { "df": 2, "docs": { - "3": { + "4": { "tf": 1.0 }, - "6": { + "7": { "tf": 1.0 } } @@ -672,6 +804,66 @@ "r": { "df": 0, "docs": {}, + "e": { + "df": 0, + "docs": {}, + "p": { + "df": 0, + "docs": {}, + "r": { + "df": 0, + "docs": {}, + "o": { + "c": { + "df": 0, + "docs": {}, + "e": { + "df": 0, + "docs": {}, + "s": { + "df": 0, + "docs": {}, + "s": { + "df": 0, + "docs": {}, + "o": { + "df": 0, + "docs": {}, + "r": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + } + } + } + } + } + }, + "df": 0, + "docs": {} + } + } + }, + "t": { + "df": 0, + "docs": {}, + "t": { + "df": 0, + "docs": {}, + "i": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + } + } + } + }, "i": { "df": 0, "docs": {}, @@ -705,7 +897,7 @@ "o": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -717,7 +909,7 @@ "i": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -743,7 +935,7 @@ "t": { "df": 1, "docs": { - "8": { + "9": { "tf": 1.0 } } @@ -766,7 +958,7 @@ "s": { "df": 1, "docs": { - "6": { + "7": { "tf": 1.0 } } @@ -781,8 +973,12 @@ "df": 0, "docs": {}, "n": { - "df": 0, - "docs": {}, + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + }, "n": { "a": { "b": { @@ -791,7 +987,7 @@ "l": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -810,7 +1006,7 @@ "t": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -832,10 +1028,10 @@ "d": { "df": 2, "docs": { - "6": { + "7": { "tf": 1.0 }, - "7": { + "8": { "tf": 1.0 } } @@ -856,10 +1052,10 @@ "n": { "df": 2, "docs": { - "2": { + "3": { "tf": 1.0 }, - "4": { + "5": { "tf": 1.0 } } @@ -873,7 +1069,7 @@ "e": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -897,7 +1093,7 @@ "t": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -923,7 +1119,7 @@ "i": { "df": 1, "docs": { - "6": { + "7": { "tf": 1.0 } } @@ -940,7 +1136,7 @@ "e": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -965,7 +1161,7 @@ "l": { "df": 1, "docs": { - "3": { + "4": { "tf": 1.0 } } @@ -984,10 +1180,10 @@ "t": { "df": 2, "docs": { - "0": { + "1": { "tf": 1.0 }, - "1": { + "2": { "tf": 1.0 } } @@ -1008,7 +1204,7 @@ "d": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1052,7 +1248,7 @@ "u": { "df": 1, "docs": { - "3": { + "4": { "tf": 1.0 } } @@ -1071,7 +1267,46 @@ } } }, + "b": { + "df": 0, + "docs": {}, + "o": { + "df": 0, + "docs": {}, + "o": { + "df": 0, + "docs": {}, + "k": { + "df": 2, + "docs": { + "0": { + "tf": 1.4142135623730952 + }, + "7": { + "tf": 1.0 + } + } + } + } + } + }, "c": { + "a": { + "df": 0, + "docs": {}, + "u": { + "df": 0, + "docs": {}, + "s": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + } + } + }, "df": 0, "docs": {}, "h": { @@ -1090,22 +1325,22 @@ "r": { "df": 6, "docs": { - "1": { + "2": { "tf": 1.4142135623730952 }, - "3": { - "tf": 1.7320508075688773 - }, "4": { - "tf": 1.0 + "tf": 1.7320508075688773 }, "5": { "tf": 1.0 }, "6": { - "tf": 2.0 + "tf": 1.0 }, "7": { + "tf": 2.0 + }, + "8": { "tf": 1.4142135623730952 } } @@ -1124,10 +1359,10 @@ "e": { "df": 2, "docs": { - "3": { + "4": { "tf": 1.0 }, - "7": { + "8": { "tf": 1.0 } } @@ -1148,10 +1383,10 @@ "s": { "df": 2, "docs": { - "6": { + "7": { "tf": 1.0 }, - "8": { + "9": { "tf": 1.4142135623730952 } } @@ -1167,9 +1402,32 @@ "d": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } + }, + "u": { + "df": 0, + "docs": {}, + "m": { + "df": 0, + "docs": {}, + "m": { + "df": 0, + "docs": {}, + "i": { + "df": 2, + "docs": { + "0": { + "tf": 1.4142135623730952 + }, + "7": { + "tf": 1.0 + } + } + } + } + } } }, "df": 0, @@ -1186,7 +1444,7 @@ "n": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1204,7 +1462,7 @@ "d": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1228,12 +1486,15 @@ "df": 0, "docs": {}, "e": { - "df": 2, + "df": 3, "docs": { - "3": { + "0": { "tf": 1.0 }, - "7": { + "4": { + "tf": 1.0 + }, + "8": { "tf": 1.0 } } @@ -1248,12 +1509,9 @@ "t": { "df": 5, "docs": { - "1": { + "2": { "tf": 1.4142135623730952 }, - "3": { - "tf": 1.0 - }, "4": { "tf": 1.0 }, @@ -1261,6 +1519,9 @@ "tf": 1.0 }, "6": { + "tf": 1.0 + }, + "7": { "tf": 1.4142135623730952 } } @@ -1271,12 +1532,32 @@ "n": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } } }, + "g": { + "df": 0, + "docs": {}, + "o": { + "df": 0, + "docs": {}, + "o": { + "d": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + }, + "df": 0, + "docs": {} + } + } + }, "h": { "df": 0, "docs": {}, @@ -1290,14 +1571,17 @@ "'": { "df": 1, "docs": { - "0": { + "1": { "tf": 1.0 } } }, - "df": 1, + "df": 2, "docs": { - "8": { + "0": { + "tf": 1.0 + }, + "9": { "tf": 1.0 } } @@ -1315,7 +1599,7 @@ "n": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1327,7 +1611,7 @@ "e": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1351,10 +1635,10 @@ "d": { "df": 2, "docs": { - "5": { + "6": { "tf": 1.4142135623730952 }, - "6": { + "7": { "tf": 1.0 } } @@ -1364,6 +1648,22 @@ } } }, + "d": { + "df": 0, + "docs": {}, + "e": { + "df": 0, + "docs": {}, + "x": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + } + } + }, "df": 0, "docs": {}, "s": { @@ -1378,7 +1678,7 @@ "t": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1404,7 +1704,7 @@ "t": { "df": 1, "docs": { - "0": { + "1": { "tf": 1.0 } } @@ -1427,10 +1727,10 @@ "t": { "df": 2, "docs": { - "0": { + "1": { "tf": 1.4142135623730952 }, - "6": { + "7": { "tf": 1.0 } } @@ -1447,6 +1747,22 @@ } } }, + "j": { + "df": 0, + "docs": {}, + "o": { + "b": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + }, + "df": 0, + "docs": {} + } + }, "l": { "df": 0, "docs": {}, @@ -1459,7 +1775,7 @@ "e": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1489,7 +1805,7 @@ "t": { "df": 1, "docs": { - "8": { + "9": { "tf": 1.0 } } @@ -1517,7 +1833,7 @@ "n": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1529,7 +1845,7 @@ "e": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1547,7 +1863,7 @@ "e": { "df": 1, "docs": { - "1": { + "2": { "tf": 1.0 } } @@ -1567,10 +1883,10 @@ "t": { "df": 2, "docs": { - "3": { + "4": { "tf": 1.4142135623730952 }, - "6": { + "7": { "tf": 1.0 } } @@ -1584,6 +1900,66 @@ "r": { "df": 0, "docs": {}, + "e": { + "df": 0, + "docs": {}, + "p": { + "df": 0, + "docs": {}, + "r": { + "df": 0, + "docs": {}, + "o": { + "c": { + "df": 0, + "docs": {}, + "e": { + "df": 0, + "docs": {}, + "s": { + "df": 0, + "docs": {}, + "s": { + "df": 0, + "docs": {}, + "o": { + "df": 0, + "docs": {}, + "r": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + } + } + } + } + } + }, + "df": 0, + "docs": {} + } + } + }, + "t": { + "df": 0, + "docs": {}, + "t": { + "df": 0, + "docs": {}, + "i": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + } + } + } + }, "i": { "df": 0, "docs": {}, @@ -1617,7 +1993,7 @@ "o": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1629,7 +2005,7 @@ "i": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1655,7 +2031,7 @@ "t": { "df": 1, "docs": { - "8": { + "9": { "tf": 1.0 } } @@ -1678,7 +2054,7 @@ "s": { "df": 1, "docs": { - "6": { + "7": { "tf": 1.0 } } @@ -1693,8 +2069,12 @@ "df": 0, "docs": {}, "n": { - "df": 0, - "docs": {}, + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + }, "n": { "a": { "b": { @@ -1703,7 +2083,7 @@ "l": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1722,7 +2102,7 @@ "t": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1744,10 +2124,10 @@ "d": { "df": 2, "docs": { - "6": { + "7": { "tf": 1.0 }, - "7": { + "8": { "tf": 1.4142135623730952 } } @@ -1768,10 +2148,10 @@ "n": { "df": 2, "docs": { - "2": { + "3": { "tf": 1.4142135623730952 }, - "4": { + "5": { "tf": 1.4142135623730952 } } @@ -1785,7 +2165,7 @@ "e": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1809,7 +2189,7 @@ "t": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1835,7 +2215,7 @@ "i": { "df": 1, "docs": { - "6": { + "7": { "tf": 1.4142135623730952 } } @@ -1852,7 +2232,7 @@ "e": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1877,7 +2257,7 @@ "l": { "df": 1, "docs": { - "3": { + "4": { "tf": 1.0 } } @@ -1896,10 +2276,10 @@ "t": { "df": 2, "docs": { - "0": { + "1": { "tf": 1.0 }, - "1": { + "2": { "tf": 1.0 } } @@ -1920,7 +2300,7 @@ "d": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -1935,6 +2315,26 @@ }, "title": { "root": { + "b": { + "df": 0, + "docs": {}, + "o": { + "df": 0, + "docs": {}, + "o": { + "df": 0, + "docs": {}, + "k": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + } + } + } + }, "c": { "df": 0, "docs": {}, @@ -1954,13 +2354,13 @@ "r": { "df": 3, "docs": { - "1": { + "2": { "tf": 1.0 }, - "3": { + "4": { "tf": 1.0 }, - "7": { + "8": { "tf": 1.0 } } @@ -1988,7 +2388,7 @@ "s": { "df": 1, "docs": { - "8": { + "9": { "tf": 1.0 } } @@ -2001,6 +2401,30 @@ } } }, + "d": { + "df": 0, + "docs": {}, + "u": { + "df": 0, + "docs": {}, + "m": { + "df": 0, + "docs": {}, + "m": { + "df": 0, + "docs": {}, + "i": { + "df": 1, + "docs": { + "0": { + "tf": 1.0 + } + } + } + } + } + } + }, "df": 0, "docs": {}, "f": { @@ -2018,7 +2442,7 @@ "t": { "df": 1, "docs": { - "1": { + "2": { "tf": 1.0 } } @@ -2041,7 +2465,7 @@ "d": { "df": 1, "docs": { - "5": { + "6": { "tf": 1.0 } } @@ -2070,7 +2494,7 @@ "t": { "df": 1, "docs": { - "0": { + "1": { "tf": 1.0 } } @@ -2099,7 +2523,7 @@ "t": { "df": 1, "docs": { - "3": { + "4": { "tf": 1.0 } } @@ -2121,7 +2545,7 @@ "d": { "df": 1, "docs": { - "7": { + "8": { "tf": 1.0 } } @@ -2142,10 +2566,10 @@ "n": { "df": 2, "docs": { - "2": { + "3": { "tf": 1.0 }, - "4": { + "5": { "tf": 1.0 } } @@ -2173,7 +2597,7 @@ "i": { "df": 1, "docs": { - "6": { + "7": { "tf": 1.0 } } diff --git a/tests/testing.rs b/tests/testing.rs index 2a32dacc..48e02892 100644 --- a/tests/testing.rs +++ b/tests/testing.rs @@ -23,7 +23,7 @@ fn mdbook_can_correctly_test_a_passing_book() { #[test] fn mdbook_detects_book_with_failing_tests() { let temp = DummyBook::new().with_passing_test(false).build().unwrap(); - let mut md: MDBook = MDBook::load(temp.path()).unwrap(); + let mut md = MDBook::load(temp.path()).unwrap(); assert!(md.test(vec![]).is_err()); }