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) -> bool { ... }
}
Expand description

An operation which is run immediately after loading a book into memory and before it gets rendered.

Required Methods§

source

fn name(&self) -> &str

Get the Preprocessor’s name.

source

fn run(&self, ctx: &PreprocessorContext, book: Book) -> Result<Book>

Run this Preprocessor, allowing it to update the book before it is given to a renderer.

Provided Methods§

source

fn supports_renderer(&self, _renderer: &str) -> bool

A hint to MDBook whether this preprocessor is compatible with a particular renderer.

By default, always returns true.

Implementors§