| Crates.io | herb |
| lib.rs | herb |
| version | 0.8.8 |
| created_at | 2025-11-02 17:51:22.852644+00 |
| updated_at | 2026-01-18 23:25:49.673447+00 |
| description | Rust bindings for Herb |
| homepage | |
| repository | https://github.com/marcoroth/herb |
| max_upload_size | |
| id | 1913394 |
| size | 3,271,066 |
Rust bindings for Herb - Powerful and seamless HTML-aware ERB parsing and tooling.
make build # Build debug binary
make release # Build release binary
make all # Generate templates and build
./bin/herb-rust version
./bin/herb-rust lex path/to/file.erb
./bin/herb-rust parse path/to/file.erb
use herb::{lex, parse};
fn main() {
let template = "<h1><%= title %></h1>";
match lex(template) {
Ok(result) => { println!("{}", result); }
Err(error) => { eprintln!("Lex error: {}", error); }
}
match parse(template) {
Ok(result) => { println!("{}", result); }
Err(error) => { eprintln!("Parse error: {}", error); }
}
}
cargo test
Before publishing to crates.io, vendor the C sources:
make vendor # Vendor C sources from ../src and prism
cargo publish --allow-dirty # Publish to crates.io
The vendor/ directory is gitignored to avoid committing duplicate files. The make vendor task copies C sources from the parent directory into vendor/libherb and vendor/prism so the published crate is self-contained.
make clean