| Crates.io | brik |
| lib.rs | brik |
| version | 0.10.0 |
| created_at | 2025-10-24 21:12:13.327974+00 |
| updated_at | 2025-11-11 20:37:03.956523+00 |
| description | HTML tree manipulation library - a building block for HTML parsing and manipulation |
| homepage | |
| repository | https://github.com/theroyalwhee0/brik |
| max_upload_size | |
| id | 1899271 |
| size | 501,548 |
A Rust library for parsing, manipulating, and querying HTML documents using CSS selectors.
This is a fork of Kuchiki (朽木) by way of Brave's Kuchikiki fork. The original Kuchiki is now unmaintained.
Brik is a building block for HTML manipulation - simple, solid, and stackable.
This fork maintains compatibility with current servo crates (html5ever, selectors, etc.) and provides ongoing updates. See the Changelog for version history and updates.
⚠️ Status: Alpha - Passes all tests but not yet recommended for production use.
Add this to your Cargo.toml:
[dependencies]
brik = "0.10.0"
This migration applies to both Kuchiki and Kuchikiki.
[dependencies]
brik = "0.10.0" # Changed from "kuchiki" or "kuchikiki"
Update your code:
use brik::parse_html; // Changed from kuchiki or kuchikiki
use brik::traits::*;
use brik::parse_html;
use brik::traits::*;
// Parse HTML and query with CSS selectors
let document = parse_html().one("<p class='greeting'>Hello, world!</p>");
let greeting = document.select_first(".greeting").unwrap();
println!("{}", greeting.text_contents());
For more detailed examples, see the examples directory.
By default, brik uses unsafe code for performance. To build without any unsafe blocks:
[dependencies]
brik = { version = "0.10.0", features = ["safe"] }
Or via command line:
cargo build --features safe
cargo test --features safe
Note: This only affects brik's code, not its dependencies.
XML/SVG namespace support is available via the namespaces feature:
[dependencies]
brik = { version = "0.10.0", features = ["namespaces"] }
This enables:
svg|rect, [xlink|href])namespace_uri(), prefix())get_ns(), insert_ns(), etc.)Or via command line:
cargo build --features namespaces
cargo test --features namespaces
cargo run --example namespaces --features namespaces
Note: HTML-only users can omit this feature to reduce binary size.
Full API documentation is available at docs.rs/brik.
Run examples with:
cargo run --example quickstart
cargo run --example find_matches
See the examples directory for all available examples.
See the Security Policy for information on reporting vulnerabilities.
This project builds on the work of:
Brik is maintained by Adam Mill (@theroyalwhee0)
Contributions are welcome! Please see our Contributing Guidelines and Code of Conduct before submitting a Pull Request.
Licensed under the MIT license. See LICENSE for details.