#html-macro #yew #front-end #extension #web

macro yew-html-ext

Handy syntactic extensions for Yew's HTML macros

5 releases

0.2.0 Nov 18, 2024
0.1.3 Feb 26, 2024
0.1.2 Feb 25, 2024
0.1.1 Feb 14, 2024
0.1.0 Feb 14, 2024

#470 in WebAssembly

Download history 22/week @ 2024-09-20 20/week @ 2024-09-27 1/week @ 2024-10-04 133/week @ 2024-11-15 19/week @ 2024-11-22 6/week @ 2024-11-29 9/week @ 2024-12-06

167 downloads per month

MIT license

125KB
3K SLoC

yew-html-ext

Crates.io Version docs.rs

Write HTML in Rust more concisely

yew-html-ext provides a drop-in replacement for Yew's html! and html_nested! macros with a number of syntactic extensions. Being a drop-in replacement, all one has to do to start benefitting from this library is:

  1. Add it to the project's dependencies
[dependencies]
yew-html-ext = "0.1"
  1. Replace uses/imports of yew::html{_nested} with yew_html_ext::html{_nested}

The provided macros facilitate an experimental ground for potential additions to Yew HTML proper, which is why the base features are untouched, only new ones are added. The specific syntax provided by the library is explained in the docs

Format this new fancy HTML

yew-fmt has support for this extended syntax, which is however opt-in and is to be enabled by adding the following line to rustfmt.toml:

yew.html_flavor = "Ext"

More on this here

Dependencies

~295–770KB
~17K SLoC