@@ -496,6 +496,12 @@ pub struct BuildConfig {
496
496
pub use_default_preprocessors : bool ,
497
497
/// Extra directories to trigger rebuild when watching/serving
498
498
pub extra_watch_dirs : Vec < PathBuf > ,
499
+ /// Should missing a preprocessor be considered an error?
500
+ /// By default, the application raises a warning instead and continue generation,
501
+ /// even if the book may be generated incorrectly.
502
+ /// Set this flag to ̀false` to consider this an error, and exits the application
503
+ /// if a preprocessor is missing.
504
+ pub error_on_missing_preprocessor : bool ,
499
505
}
500
506
501
507
impl Default for BuildConfig {
@@ -505,6 +511,7 @@ impl Default for BuildConfig {
505
511
create_missing : true ,
506
512
use_default_preprocessors : true ,
507
513
extra_watch_dirs : Vec :: new ( ) ,
514
+ error_on_missing_preprocessor : false ,
508
515
}
509
516
}
510
517
}
@@ -831,6 +838,7 @@ mod tests {
831
838
build-dir = "outputs"
832
839
create-missing = false
833
840
use-default-preprocessors = true
841
+ error-on-missing-preprocessor = false
834
842
835
843
[output.html]
836
844
theme = "./themedir"
@@ -872,6 +880,7 @@ mod tests {
872
880
create_missing : false ,
873
881
use_default_preprocessors : true ,
874
882
extra_watch_dirs : Vec :: new ( ) ,
883
+ error_on_missing_preprocessor : false ,
875
884
} ;
876
885
let rust_should_be = RustConfig { edition : None } ;
877
886
let playground_should_be = Playground {
@@ -1083,6 +1092,8 @@ mod tests {
1083
1092
create_missing : true ,
1084
1093
use_default_preprocessors : true ,
1085
1094
extra_watch_dirs : Vec :: new ( ) ,
1095
+ error_on_missing_preprocessor : false , // This flag is missing from "src" string,
1096
+ // so it should be false to ensure backward compatibility
1086
1097
} ;
1087
1098
1088
1099
let html_should_be = HtmlConfig {
0 commit comments