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

Custom license

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 Elements.

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>

No runtime deps