23 releases

0.2.5 Jun 3, 2024
0.2.2 Feb 20, 2023
0.2.1 Nov 8, 2021
0.1.14 Jul 28, 2021
0.1.4 Mar 16, 2019

#1095 in Procedural macros

Download history 21/week @ 2024-09-01 13/week @ 2024-09-08 9/week @ 2024-09-15 47/week @ 2024-09-22 98/week @ 2024-09-29 7/week @ 2024-10-06 8/week @ 2024-10-13 5/week @ 2024-10-20 8/week @ 2024-10-27 23/week @ 2024-11-03 21/week @ 2024-11-10 41/week @ 2024-11-17 11/week @ 2024-11-24 27/week @ 2024-12-01 120/week @ 2024-12-08 25/week @ 2024-12-15

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

MIT/Apache

62KB
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

~235–680KB
~16K SLoC