pub trait Printer: ParserConfig {
fn print_code_block<'a>(&self, block: &CodeBlock<'a>) -> String;
fn print_text_block<'a>(&self, block: &TextBlock<'a>) -> String;
fn print_name(&self, name: String, vars: &[&str]) -> String { ... }
fn print_line<'a>(&self, line: &Line<'a>, print_comments: bool) -> String { ... }
}
Expand description
A Printer
can invert the parsing process, printing the code blocks how they should be
rendered in the documentation text.
Required Methods
sourcefn print_code_block<'a>(&self, block: &CodeBlock<'a>) -> String
fn print_code_block<'a>(&self, block: &CodeBlock<'a>) -> String
Prints a code block
sourcefn print_text_block<'a>(&self, block: &TextBlock<'a>) -> String
fn print_text_block<'a>(&self, block: &TextBlock<'a>) -> String
Prints a text block
Provided Methods
sourcefn print_name(&self, name: String, vars: &[&str]) -> String
fn print_name(&self, name: String, vars: &[&str]) -> String
Fills a name with its placeholders
sourcefn print_line<'a>(&self, line: &Line<'a>, print_comments: bool) -> String
fn print_line<'a>(&self, line: &Line<'a>, print_comments: bool) -> String
Prints a line of a code block