html
html copied to clipboard
naming of functions on builder
I want to implement a rsx like macro:
rsx! {
<div>
<img />
<a> </a>
<audio/>
</div>
}
That would roughly generate something like
Division::builder()
.image()
.anchor()
.audio()
// ...
That generates html, and wanted to use this crate for the type safe generation of the html.
One issue I have, then, is that for some elements like audio
it would be easy to map to the builder functions, but some like a
or img
I need to translate to anchor
and image
respectively.
Is there a list of all of these mappings? Or could html
somehow provide such an interface that uses the actual tags as function names. The latter is probably a high ask for something that maybe I have the only usecase for.