Expand description
Brik is an HTML tree manipulation library for Rust.
A building block for HTML parsing and manipulation - simple, solid, and stackable.
§Quick Start
use brik::parse_html;
use brik::traits::*;
let document = parse_html().one("<p class='greeting'>Hello, world!</p>");
let greeting = document.select_first(".greeting").unwrap();
assert_eq!(greeting.text_contents(), "Hello, world!");Re-exports§
pub use parser::parse_fragment;pub use parser::parse_fragment;pub use parser::parse_fragment_with_options;pub use parser::parse_html;pub use parser::parse_html;pub use parser::parse_html_with_options;pub use parser::ParseOpts;pub use parser::Sink;
Modules§
- iter
- Node iteration and traversal. Node iterators
- parser
- HTML parsing into the tree structure. HTML parsing functionality.
- traits
- This module re-exports a number of traits that are useful when using Brik. It can be used with:
Structs§
- Attribute
- The non-identifying parts of an attribute
- Attributes
- Convenience wrapper around a indexmap that adds method for attributes in the null namespace.
- Doctype
- Data specific to doctype nodes.
- Document
Data - Data specific to document nodes.
- Element
Data - Data specific to element nodes.
- Expanded
Name - https://www.w3.org/TR/REC-xml-names/#dt-expname
- Node
- A node inside a DOM-like tree.
- Node
Data Ref - Holds a strong reference to a node, but dereferences to some component inside of it.
- NodeRef
- A strong reference to a node.
- Selector
- A pre-compiled CSS Selector.
- Selector
Context - Context for compiling CSS selectors.
- Selectors
- A pre-compiled list of CSS Selectors.
- Specificity
- The specificity of a selector.
Enums§
- Node
Data - Node data specific to the node type.