News for hackers. Stuff that matters.
Re:Maud: A Rust macro for writing HTML by dustymcp on Tuesday June 07, 2022 @03:04AM (#31650774)
Isnt it just easier to have a html file then replace tags inside of that rather than having a new macro language ?
Re:Maud: A Rust macro for writing HTML by tannhaeuser on Tuesday June 07, 2022 @04:13AM (#31651230)
SGML (the markup meta-language once used for describing HTML) has that, but as we're talking the verdict is still out whether that's actually easier [1] ;) But anyway, SGML gives you HTML-aware, context-dependent, injection-free templating (even with hard support for sanitizing user content) in a content authoring workflow independent from a hosting programming language so is in a different ball park.

[1]: https://news.ycombinator.com/item?id=31637910

Re:Maud: A Rust macro for writing HTML by josephg on Tuesday June 07, 2022 @03:10AM (#31650814)
This also supports conditional expressions and loops:

https://maud.lambda.xyz/control-structures.html

Re:Maud: A Rust macro for writing HTML by fredrb on Tuesday June 07, 2022 @03:29AM (#31650926)
So does most templating languages.