pub trait Callbacks {
    fn extension(&self) -> &'static str;
    fn generate_files(
        &mut self,
        generator: Generator<'_>
    ) -> HashMap<String, String>; fn encode(&mut self, s: &mut String, events: Vec<Event<'_>>); fn start_method(
        &mut self,
        _s: &mut String,
        _resolver: &Resolver,
        _method: &Method
    ) { ... } fn start_property(
        &mut self,
        _s: &mut String,
        _resolver: &Resolver,
        _property: &Property
    ) { ... } }
Expand description

Callbacks to encode markdown input in a given format.

This trait should be implemented if you want to make your own backend.

Required Methods

File extension for the files generated by this callback.

Drive the generation process.

This returns a map from file names (relative to the output directory) to their contents.

You can find inspiration about how to implement this in the source code, for example in src/backend/html.rs.

Encode the stream of events in s.

Provided Methods

Called before encoding each method.

Default: does nothing

Called before encoding each property.

Default: does nothing

Implementations

Default start_method implementation, implemented on dyn Callbacks to avoid code duplication.

This will create a level 3 header that looks like (in markdown):

## <a id="func-name"></a>func name(arg1: [type](link), ...) -> [type](link)
________

With appropriate linking.

Default start_property implementation, implemented on dyn Callbacks to avoid code duplication.

This will create a level 3 header that looks like (in markdown):

## <a id="property-name"></a> name: [type](link)
________

With appropriate linking.

Trait Implementations

Formats the value using the given formatter. Read more

Implementors