html icon indicating copy to clipboard operation
html copied to clipboard

naming of functions on builder

Open ModProg opened this issue 1 year ago • 0 comments

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.

ModProg avatar Sep 02 '23 23:09 ModProg