Crates.io | straw |
lib.rs | straw |
version | 0.3.0 |
source | src |
created_at | 2016-01-24 20:22:44.683417 |
updated_at | 2016-01-31 19:26:22.761004 |
description | WIP Rust -> HTML renderer |
homepage | |
repository | https://github.com/BlakeWilliams/straw |
max_upload_size | |
id | 3981 |
size | 7,785 |
Work in progress Experimental Rust -> HTML renderer.
Add straw to Cargo.toml
.
[dependencies]
straw = "*"
Import Element
and Renderable
and start creating Element
s.
extern crate straw;
use straw::element::{Element, Renderable}
use straw::attribute::Attr;
let element = Element::new("div", vec![Attr::id("main")], vec![
Element::new("h1", vec![], "Hello"),
Element::new("input", vec![Attr::disabled(true)], ""),
]);
element.render(); // <div id="main"><h1>Hello</h1><input disabled></input></div>