Skip to main content

Crate htmlite

Crate htmlite 

Source
Expand description

HTML parsing, generation and manipulation.

Use parse to parse an HTML string. This returns a tree of HTML nodes. The methods on Node allow you to traverse & manipulate the tree.

For generating HTML programmatically, take a look at the html declarative macro.

Macros§

html
This macro implements a syntax for creating HTML Nodes.

Structs§

Descendants
Node
A handle to a node in a DOM-like tree.
ParserError
An error that occurs while constructing an HTML tree.
Selection
An iterator of nodes matching a particular css selector.

Enums§

ErrorCode
Frame
NodeKind
Types of nodes that might exist in an HTML document.

Functions§

comment
Returns a new comment node with the given contents.
deep_copy
Creates a deep-copy of node by recursively building a tree out of deep copies of its children.
doctype
Returns a new doctype “html” node.
fragment
Returns a new fragment with the given nodes.
mark_foreign_subtree
Marks root and all descendant element nodes as belonging to a foreign namespace.
parse
Parses the given HTML fragment.
raw_text
Returns a new text node with the given contents.
select
Returns a new iterator that only yields elements from iter matching the given CSS selector.
tag
Returns a new element node with the given name and attributes.
text
Returns a new text node with the given contents.