html-macro

Crates.iohtml-macro
lib.rshtml-macro
version0.2.5
sourcesrc
created_at2019-01-27 15:24:02.364381
updated_at2024-06-03 18:30:47.208775
descriptionhtml macro
homepage
repositoryhttps://github.com/chinedufn/percy
max_upload_size
id110936
size52,830
Chinedu Francis Nwafili (chinedufn)

documentation

https://chinedufn.github.io/percy/api/html_macro/

README

html-macro

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);
}
Commit count: 765

cargo fmt