Trait Component

Source
pub trait Component {
    // Required methods
    fn name(&self) -> &str;
    fn render(
        &self,
        attributes: &HashMap<String, String>,
        children: &[Node],
    ) -> Result<String, Error>;

    // Provided method
    fn css(&self) -> Option<String> { ... }
}
Expand description

Trait for custom markdown components

Required Methods§

Source

fn name(&self) -> &str

The name of the component as used in markdown

Source

fn render( &self, attributes: &HashMap<String, String>, children: &[Node], ) -> Result<String, Error>

Render the component to HTML

Provided Methods§

Source

fn css(&self) -> Option<String>

Process any CSS needed for the component

Implementors§