pub trait Preprocessor {
// Required methods
fn name(&self) -> &str;
fn run(&self, ctx: &PreprocessorContext, book: Book) -> Result<Book>;
// Provided method
fn supports_renderer(&self, _renderer: &str) -> Result<bool> { ... }
}Expand description
An operation which is run immediately after loading a book into memory and before it gets rendered.
Types that implement the Preprocessor trait can be used with
MDBook::with_preprocessor to programmatically add preprocessors.
Required Methods§
Provided Methods§
Sourcefn supports_renderer(&self, _renderer: &str) -> Result<bool>
fn supports_renderer(&self, _renderer: &str) -> Result<bool>
A hint to MDBook whether this preprocessor is compatible with a
particular renderer.
By default, always returns true.