Trait mdman::format::Formatter

source ·
pub trait Formatter {
    // Required methods
    fn render(&self, input: &str) -> Result<String, Error>;
    fn render_options_start(&self) -> &'static str;
    fn render_options_end(&self) -> &'static str;
    fn render_option(
        &self,
        params: &[&str],
        block: &str,
        man_name: &str,
    ) -> Result<String, Error>;
    fn linkify_man_to_md(
        &self,
        name: &str,
        section: u8,
    ) -> Result<String, Error>;
}

Required Methods§

source

fn render(&self, input: &str) -> Result<String, Error>

Renders the given markdown to the formatter’s output.

source

fn render_options_start(&self) -> &'static str

Renders the start of a block of options (triggered by {{#options}}).

source

fn render_options_end(&self) -> &'static str

Renders the end of a block of options (triggered by {{/options}}).

source

fn render_option( &self, params: &[&str], block: &str, man_name: &str, ) -> Result<String, Error>

Renders an option (triggered by {{#option}}).

source

fn linkify_man_to_md(&self, name: &str, section: u8) -> Result<String, Error>

Converts a man page reference into markdown that is appropriate for this format.

Triggered by {{man name section}}.

Implementors§