Chore: fix up html macro

This commit is contained in:
Jonathan Kelley 2021-01-19 08:53:47 -05:00
parent 3475adaaa6
commit ae1b8bbede
2 changed files with 5 additions and 21 deletions

View file

@ -1,9 +1,10 @@
[package]
name = "html-macro"
version = "0.1.9"
description = "html macro"
name = "dioxus-html-macro"
version = "0.1.0"
description = "HTML-compliant macro for creating Dioxus VNodes"
authors = [
"Jonathan Kelley",
# Originally pulled from Percy - check it out!
"Chinedu Francis Nwafili <frankie.nwafili@gmail.com>",
]
keywords = ["virtual", "dom", "wasm", "assembly", "webassembly"]

View file

@ -1,20 +1,3 @@
# html-macro
```rust
use html_macro::*;
fn main () {
let component = html! { <div id='component'>Some component</div> };
let text_var = "You can interpolate text variables";
let html = html! {
<div onclick=|_ev: web_sys::MouseEvent| {}>
You can type text right into the elements
{ component }
{ text_var }
</div>
};
println!("{}", node);
}
```
Disclaimer: much of this macro's source comes from Percy - another vdom implementation for Rust.