3 ms·
Very glad to see this. I've used type-safe templates in Haskell, and I've been hoping to see something similar in Rust. It looks like Maud has good defaults a
by JoshTriplett 11y ago
Very glad to see this. I've used type-safe templates in Haskell, and I've been hoping to see something similar in Rust. It looks like Maud has good defaults as well, such as escaping HTML by default.
I wonder if it would make sense to have splicing of previously created Maud values not escape them. That seems like the most common case where you'd end up using $$ otherwise: piecemeal generation of HTML fragments. Since Maud has a special type to represent the result of a template, it could recognize that type in a splice.
Also, the need to handle control structures inline (such as $if and $for) seems like it could be replaced with a mechanism to splice in arbitrary Rust code of the appropriate type. Because otherwise, Maud would need to handle things like $match.
Props for the name and documentation as well.
- pc2g4d 11y agoIn what way is the "Maud" name appropriate? I mean, I like it, but your comment makes me wonder if there's more to it. All I can think of is that Tennyson poem... I guess it's been described as "ironic"!
- JoshTriplett 11y agoIt doesn't necessarily match the software, but if you read the documentation, the source of the name (and many others) should quickly become evident.