20 releases

0.2.2 Feb 20, 2023
0.2.1 Nov 8, 2021
0.1.15 Aug 6, 2021
0.1.14 Jul 28, 2021
0.1.4 Mar 16, 2019

#1391 in Procedural macros

Download history 56/week @ 2024-01-08 118/week @ 2024-01-15 115/week @ 2024-01-22 57/week @ 2024-01-29 39/week @ 2024-02-05 117/week @ 2024-02-12 112/week @ 2024-02-19 122/week @ 2024-02-26 106/week @ 2024-03-04 99/week @ 2024-03-11 85/week @ 2024-03-18 24/week @ 2024-03-25 100/week @ 2024-04-01 23/week @ 2024-04-08 23/week @ 2024-04-15 34/week @ 2024-04-22

184 downloads per month
Used in 5 crates (3 directly)

MIT/Apache

56KB
1K SLoC

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);
}

Dependencies

~1.5MB
~33K SLoC