Closed imbolc closed 11 months ago
Have you seen this?
https://github.com/yoshuawuyts/html
In general I'm against validation (except the bare minimum needed for security – see #181). Because it's a lot of work, and also I don't think Maud can do it better than the html
crate.
I'm not suggesting that Maud should implement the entire HTML specification. I don't even think it would be enough, considering enhancements like Htmx. However, I would like Maud to provide support for typed tags (e.g., through a derivable trait). Typically, projects use a small subset of tags and their attributes, which isn't so hard to type. This approach also enables people to share typing efforts by creating specialized crates, e.g. maud-htmx.
Typically, projects use a small subset of tags and their attributes, which isn't so hard to type.
Then we're offloading the validation effort to library users. That doesn't seem like an improvement over yoshuawuyts/html.
In general I feel this suggestion is a big change, with a lot of design decisions, and really different to where the library is now. If you'd like to explore that space then I suggest rolling your own library.
It would be great to check tags attributes on compile time. Maybe something like
HtmlTag
trait one could derive to describe types:and then use it like