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

#1045 in Procedural macros

Download history 5/week @ 2024-10-23 11/week @ 2024-10-30 21/week @ 2024-11-06 27/week @ 2024-11-13 38/week @ 2024-11-20 19/week @ 2024-11-27 55/week @ 2024-12-04 92/week @ 2024-12-11 10/week @ 2024-12-18 5/week @ 2025-01-08 17/week @ 2025-01-15 21/week @ 2025-01-22 171/week @ 2025-01-29 62/week @ 2025-02-05

272 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

~215–660KB
~15K SLoC