An HTML template engine that chose composition over inheritance
```rust use hypersynthetic::prelude::*;
fn TodoItem(text: &str, done: bool) -> NodeCollection { let text_decoration = if done { "line-through" } else { "none" };
html! {
<li style="text-decoration: {text_decoration};">
{text}
</li>
}
}
fn main() { let todo_list = vec![ ("Buy Milk", true), ("Read Rust Book", false), ("Write Web App using html! macro", false), ];
let rendered_list = html! {
<ul>
<TodoItem :for={(text, done) in todo_list} text={text} done={done} />
</ul>
};
// ... Render `rendered_list` into your application.
} ```
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.