This changes it so that it is an error if there is ever an unknown configuration field. This is intended to help avoid things like typos, or using an outdated version of mdbook. Although it is possible that new fields could potentially safely be ignored, setting up a warning system is a bit more of a hassle. I don't think mdbook needs to have the same kind of multi-version support as something like cargo does. However, if this ends up being too much of a pain point, we can try to add a warning system instead. There are a variety of changes here: - The top-level config namespace is now closed so that it only accepts the keys defined in `Config`. - All config tables now reject unknown fields. - Added `Config::outputs` and `Config::preprocessors` for convenience to access the entire `output` and `preprocessor` tables. - Moved the unit-tests that were setting environment variables to the testsuite where it launches a process instead. Closes https://github.com/rust-lang/mdBook/issues/1595
30 lines
540 B
Rust
30 lines
540 B
Rust
//! Main testsuite for exercising all functionality of mdBook.
|
|
//!
|
|
//! See README.md for documentation.
|
|
|
|
#![allow(unreachable_pub, reason = "not needed in an integration test crate")]
|
|
|
|
mod book_test;
|
|
mod build;
|
|
mod cli;
|
|
mod config;
|
|
mod includes;
|
|
mod index;
|
|
mod init;
|
|
mod markdown;
|
|
mod playground;
|
|
mod preprocessor;
|
|
mod print;
|
|
mod redirects;
|
|
mod renderer;
|
|
mod rendering;
|
|
#[cfg(feature = "search")]
|
|
mod search;
|
|
mod test;
|
|
mod theme;
|
|
mod toc;
|
|
|
|
mod prelude {
|
|
pub use crate::book_test::{BookTest, read_to_string};
|
|
pub use snapbox::str;
|
|
}
|