sailfish-web 0.2.0

Simple extension crate that enables a simpler api for web server crates
Documentation
// ```test2.stpl
// <h1>Hello <b><%- s %></b></h1>
// ```

use sailfish::TemplateSimple;
use sailfish_web::option_result::Res;

#[derive(TemplateSimple)]
#[template(path = "test2.stpl")]
struct TestTemplate {
    s: Res<String, i32>,
}

fn main() {
    print!(
        "{}\n",
        TestTemplate {
            s: Ok("world".to_string()).into()
        }
        .render_once()
        .unwrap()
    );
    print!(
        "{}",
        TestTemplate { s: Err(123).into() }.render_once().unwrap()
    )
}

// Output
// <h1>Hello <b>world</b></h1>
// <h1>Hello <b>Error: 123</b></h1>