[−][src]Trait html2text::render::Renderer
A type which is a backend for HTML to text rendering.
Required methods
fn add_empty_line(&mut self)
Add an empty line to the output (ie between blocks).
fn new_sub_renderer(&self, width: usize) -> Self
Create a sub-renderer for nested blocks.
fn start_block(&mut self)
Start a new block.
fn end_block(&mut self)
Mark the end of a block.
fn new_line(&mut self)
Start a new line, if necessary (but don't add a new line).
fn new_line_hard(&mut self)
Start a new line.
fn add_horizontal_border(&mut self)
Add a horizontal table border.
fn start_pre(&mut self)
Begin a preformatted block. Until the corresponding end, whitespace will used verbatim. Pre regions can nest.
fn end_pre(&mut self)
Finish a preformatted block started with start_pre
.
fn add_inline_text(&mut self, text: &str)
Add some inline text (which should be wrapped at the appropriate width) to the current block.
fn width(&self) -> usize
Return the current width in character cells
fn add_block_line(&mut self, line: &str)
Add a line to the current block without starting a new one.
fn append_subrender<'a, I>(&mut self, other: Self, prefixes: I) where
I: Iterator<Item = &'a str>,
I: Iterator<Item = &'a str>,
Add a new block from a sub renderer, and prefix every line by the corresponding text from each iteration of prefixes.
fn append_columns_with_borders<I>(&mut self, cols: I, collapse: bool) where
I: IntoIterator<Item = Self>,
Self: Sized,
I: IntoIterator<Item = Self>,
Self: Sized,
Append a set of sub renderers joined left-to-right with a vertical line, and add a horizontal line below. If collapse is true, then merge top/bottom borders of the subrenderer with the surrounding one.
fn empty(&self) -> bool
Returns true if this renderer has no content.
fn text_len(&self) -> usize
Return the length of the contained text.
fn start_link(&mut self, target: &str)
Start a hyperlink TODO: return sub-builder or similar to make misuse of start/link harder?
fn end_link(&mut self)
Finish a hyperlink started earlier.
fn start_emphasis(&mut self)
Start an emphasised region
fn end_emphasis(&mut self)
Finish emphasised text started earlier.
fn start_strong(&mut self)
Start a strong region
fn end_strong(&mut self)
Finish strong text started earlier.
fn start_strikeout(&mut self)
Start a strikeout region
fn end_strikeout(&mut self)
Finish strikeout text started earlier.
fn start_code(&mut self)
Start a code region
fn end_code(&mut self)
End a code region
fn add_image(&mut self, title: &str)
Add an image
fn record_frag_start(&mut self, fragname: &str)
Record the start of a named HTML fragment
Implementors
impl<D: TextDecorator> Renderer for TextRenderer<D>
[src]
fn add_empty_line(&mut self)
[src]
fn new_sub_renderer(&self, width: usize) -> Self
[src]
fn start_block(&mut self)
[src]
fn new_line(&mut self)
[src]
fn new_line_hard(&mut self)
[src]
fn add_horizontal_border(&mut self)
[src]
fn start_pre(&mut self)
[src]
fn end_pre(&mut self)
[src]
fn end_block(&mut self)
[src]
fn add_inline_text(&mut self, text: &str)
[src]
fn width(&self) -> usize
[src]
fn add_block_line(&mut self, line: &str)
[src]
fn append_subrender<'a, I>(&mut self, other: Self, prefixes: I) where
I: Iterator<Item = &'a str>,
[src]
I: Iterator<Item = &'a str>,
fn append_columns_with_borders<I>(&mut self, cols: I, collapse: bool) where
I: IntoIterator<Item = Self>,
[src]
I: IntoIterator<Item = Self>,