@@ -5,11 +5,10 @@ use std::{
55
66use clap:: { Arg , ArgMatches , Command } ;
77use 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} ;
1413use semver:: { Version , VersionReq } ;
1514use siliconblue:: gen_siliconblue;
@@ -62,17 +61,17 @@ fn main() {
6261}
6362
6463fn 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 {
0 commit comments