macro_rules! html_basic {
(title: $t:expr, body: $($b:expr),*) => { ... };
(title: $t:expr, body: $($b:expr,)+) => { ... };
}
Expand description
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());