[][src]Trait bookbinder_ast::helpers::MarkerHelper

pub trait MarkerHelper {
    fn write_title_text<'a, I: IntoIterator<Item = Event<'a>> + Debug>(
        events: I
    ) -> String;
fn escape<'a, S: Into<Cow<'a, str>>>(text: S) -> Cow<'a, str>; fn escape_cowstr(text: CowStr<'_>) -> Cow<'_, str> { ... }
fn filter_title_events<'a, I: IntoIterator<Item = Event<'a>> + Debug>(
        events: I
    ) -> Vec<Event<'a>> { ... } }

Helpers to do with formatting and writing events for a particular output format.

Required methods

fn write_title_text<'a, I: IntoIterator<Item = Event<'a>> + Debug>(
    events: I
) -> String

write escaped title text to a string in the appropriate format. For example, Hello *world* (as events) might become the string Hello <em>world</em> or Hello \emph{world}`

fn escape<'a, S: Into<Cow<'a, str>>>(text: S) -> Cow<'a, str>

escape text for the output format

Loading content...

Provided methods

fn escape_cowstr(text: CowStr<'_>) -> Cow<'_, str>

escape a CowStr for the output format

fn filter_title_events<'a, I: IntoIterator<Item = Event<'a>> + Debug>(
    events: I
) -> Vec<Event<'a>>

Remove events which should not be present in a title, such as block or non-textual elements

Loading content...

Implementors

impl MarkerHelper for EpubMarker[src]

impl MarkerHelper for LatexMarker[src]

Loading content...