3 releases (breaking)
Uses old Rust 2015
0.3.0 | Jan 31, 2016 |
---|---|
0.2.0 | Jan 24, 2016 |
0.1.0 | Jan 24, 2016 |
#473 in Template engine
7KB
240 lines
Straw
Work in progress Experimental Rust -> HTML renderer.
Installation
Add straw to Cargo.toml
.
[dependencies]
straw = "*"
Usage
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>