[][src]Macro dom_renderer::html_basic

macro_rules! html_basic {
    (title: $t:expr, body: $($b:expr),*) => { ... };
    (title: $t:expr, body: $($b:expr,)+) => { ... };
}

creates HTML Document contains DocumenType and HTML element

Example

use dom_renderer::*;
let html = html_basic!(
    title: "Page Title",
    body:
        end_elem!("h1"; "Section"),
        end_elem!("p"; "Text goes here..."),
);
let expect = r#"<!DOCTYPE html><html><head><meta charset="utf-8"><title>Page Title</title></head><body><h1>Section</h1><p>Text goes here...</p></body></html>"#;
assert_eq!(expect, html.render());