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

#1261 in Procedural macros

Download history 14/week @ 2023-12-14 13/week @ 2023-12-21 55/week @ 2023-12-28 81/week @ 2024-01-04 97/week @ 2024-01-11 114/week @ 2024-01-18 87/week @ 2024-01-25 42/week @ 2024-02-01 80/week @ 2024-02-08 112/week @ 2024-02-15 100/week @ 2024-02-22 127/week @ 2024-02-29 118/week @ 2024-03-07 70/week @ 2024-03-14 68/week @ 2024-03-21 36/week @ 2024-03-28

307 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