| Crates.io | fast_html2md |
| lib.rs | fast_html2md |
| version | 0.0.48 |
| created_at | 2023-12-28 17:03:50.262796+00 |
| updated_at | 2025-02-22 20:34:01.497398+00 |
| description | A fast html2md crate for rust |
| homepage | |
| repository | https://github.com/spider-rs/html2md |
| max_upload_size | |
| id | 1082532 |
| size | 198,451 |
The fastest Rust library for transforming HTML into Markdown. Designed for performance and ease-of-use in Rust projects.
Add fast_html2md to your Cargo.toml:
cargo add fast_html2md
Below are examples to get started quickly. The library provides several methods depending on your needs.
With the default rewriter feature, recommended for high performance:
let md = html2md::rewrite_html("<p>JAMES</p>", false);
assert_eq!(md, "JAMES");
For handling large or concurrent workloads, use async streaming with the stream and rewriter feature. Ensure you have a tokio async runtime:
let md = html2md::rewrite_html_streaming("<p>JAMES</p>", false).await;
assert_eq!(md, "JAMES");
For a different approach, enable the scraper feature:
let md = html2md::parse_html("<p>JAMES</p>", false);
assert_eq!(md, "JAMES");
rewriter feature (default).scraper feature.The features are split to help you choose the library you need. If your project heavily depends on scraper and you need to keep the binary small, you can enable just that feature flag. The same applies to the rewriter feature using lol_html. This project is actively used in production at Spider.
This project is licensed under the MIT License.