mdman::format

# Trait 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§

Source§

### impl Formatter for ManFormatter

Source§

### impl Formatter for MdFormatter

Source§

### impl Formatter for TextFormatter