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

#1084 in Procedural macros

Download history 18/week @ 2024-08-24 30/week @ 2024-08-31 12/week @ 2024-09-07 10/week @ 2024-09-14 46/week @ 2024-09-21 97/week @ 2024-09-28 9/week @ 2024-10-05 9/week @ 2024-10-12 5/week @ 2024-10-19 7/week @ 2024-10-26 22/week @ 2024-11-02 22/week @ 2024-11-09 38/week @ 2024-11-16 14/week @ 2024-11-23 27/week @ 2024-11-30 172/week @ 2024-12-07

266 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

~240–690KB
~16K SLoC