mdbook/src/preprocess/mod.rs
2018-01-17 09:44:52 +00:00

25 lines
No EOL
480 B
Rust

pub use self::links::LinkPreprocessor;
mod links;
use book::Book;
use config::Config;
use errors::*;
use std::path::PathBuf;
pub struct PreprocessorContext {
pub root: PathBuf,
pub config: Config,
}
impl PreprocessorContext {
pub fn new(root: PathBuf, config: Config) -> Self {
PreprocessorContext { root, config }
}
}
pub trait Preprocessor {
fn name(&self) -> &str;
fn run(&self, ctx: &PreprocessorContext, book: &mut Book) -> Result<()>;
}