Module html2text

Source

Modules§

config
Configure the HTML to text translation using the Config type, which can be constructed using one of the functions in this module.
render

Structs§

Colour
An RGB colour value
RcDom
The DOM itself; the result of parsing.
RenderNode
Common fields from a node.
RenderTable
A representation of a table render tree with metadata.
RenderTableCell
Render tree table cell
RenderTableRow
Render tree table row
RenderTree
The structure of an HTML document that can be rendered using a TextDecorator.
RenderedText
A rendered HTML document.
SizeEstimate
Size information/estimate

Enums§

Error
Errors from reading or rendering HTML
NodeData
The different kinds of nodes in the DOM.
RenderNodeInfo
The node-specific information distilled from the DOM.

Constants§

MIN_WIDTH
The min width of the doc

Functions§

dom_to_render_tree
Convert a DOM tree or subtree into a render tree.
from_read
Reads HTML from input, and returns a String with text wrapped to width columns.
from_read_rich
Reads HTML from input, and returns text wrapped to width columns. The text is returned as a Vec<TaggedLine<_>>; the annotations are vectors of RichAnnotation. The “outer” annotation comes first in the Vec.
from_read_with_decorator
Reads HTML from input, decorates it using decorator, and returns a String with text wrapped to width columns.
parse
Reads and parses HTML from input and prepares a render tree.