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

#1736 in Procedural macros

Download history 1/week @ 2024-12-21 1/week @ 2025-01-04 14/week @ 2025-01-11 18/week @ 2025-01-18 46/week @ 2025-01-25 170/week @ 2025-02-01 45/week @ 2025-02-08 40/week @ 2025-02-15 29/week @ 2025-02-22 52/week @ 2025-03-01 34/week @ 2025-03-08 73/week @ 2025-03-15 54/week @ 2025-03-22 147/week @ 2025-03-29 56/week @ 2025-04-05

337 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

~190–610KB
~14K SLoC