[][src]Trait equt_md_ext::MarkdownExt

pub trait MarkdownExt<'e>: Iterator<Item = Event<'e>> {
    fn frontmatter(&mut self) -> Option<FrontMatter>;

    fn insert<E, F>(self, after: E, create: F) -> Insert<'e, E, Self>
    where
        Self: Sized,
        E: Fn(&Event<'e>) -> bool,
        F: FnOnce(&Option<FrontMatter>) -> Option<Event<'e>>
, { ... } }

An interface for extending the original Markdown event iterator.

Required methods

fn frontmatter(&mut self) -> Option<FrontMatter>

Loading content...

Provided methods

fn insert<E, F>(self, after: E, create: F) -> Insert<'e, E, Self> where
    Self: Sized,
    E: Fn(&Event<'e>) -> bool,
    F: FnOnce(&Option<FrontMatter>) -> Option<Event<'e>>, 

Insert a custom pseudo event into the iterator after certain event.

insert takes two closures.

  • The first one will be called to determine whether the pseudo event should be inserted after the current event.

  • The second one creates the pseudo from the optional frontmatter, if the result is None, the iterator is identical to the original one.

Loading content...

Implementors

impl<'e> MarkdownExt<'e> for Parser<'e>[src]

impl<'e, E, I> MarkdownExt<'e> for Insert<'e, E, I> where
    E: Fn(&Event<'e>) -> bool,
    I: Iterator<Item = Event<'e>>, 
[src]

Loading content...