Crates.io | html-pipe |
lib.rs | html-pipe |
version | 0.1.1 |
source | src |
created_at | 2023-11-10 09:44:29.969745 |
updated_at | 2023-11-10 10:34:24.242725 |
description | A basic html component builder |
homepage | |
repository | https://github.com/jdrouet/html-pipe |
max_upload_size | |
id | 1030863 |
size | 7,001 |
The goal of this crate is to make it easier to build html components on the server side and reuse them.
cargo add html-pipe
use html_pipe::*;
let mut buf = Buffer::new();
node("html", attr("lang", "en"), node("body", noop, text("Hello World!")))(&mut buf).unwrap();
assert_eq!(buf, "<html lang=\"en\"><body>Hello World</body></html>");