2018-01-08 04:05:57 +08:00
|
|
|
pub use self::links::LinkPreprocessor;
|
|
|
|
|
|
|
|
mod links;
|
2018-01-07 23:24:37 +08:00
|
|
|
|
2018-01-08 00:21:46 +08:00
|
|
|
use book::Book;
|
|
|
|
use errors::*;
|
|
|
|
|
2018-01-08 04:05:57 +08:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
pub struct PreprocessorContext {
|
|
|
|
pub src_dir: PathBuf
|
|
|
|
}
|
2018-01-07 23:24:37 +08:00
|
|
|
|
2018-01-08 00:21:46 +08:00
|
|
|
pub trait Preprocessor {
|
2018-01-08 04:05:57 +08:00
|
|
|
fn run(&self, ctx: &PreprocessorContext, book: &mut Book) -> Result<()>;
|
2018-01-07 23:24:37 +08:00
|
|
|
}
|