-
Notifications
You must be signed in to change notification settings - Fork 1
Html text without the need of literal strings #16
Comments
Mmm I have been playing with web-sys too, trying to build something similar to Ruukh :). I ended up writing a parser for html in nom, which works quite well except I can see it's not going to parse rust code inside { }'s very easily... I wonder if we make some noise in dtolnay/syn#406 whether there's much hope on that becoming stable |
@davidhewitt Yeah, plugging nom with syn is going to be difficult and also preserving |
Hi @csharad, I don't know how feasible to implement this in your project. I tried this with my own project, but finally I prefer strings in |
@limira while I definitely see the benefits of the approach you've taken in Simi, my own preference is to have a syntax as close to HTML as possible. Though I concede that to support nice highlighting inside the html! macro will then need extra editor grammar added, I think sticking to HTML syntax gives users of the api a sense of familiarity. I suspect this is one of those things that's a matter of everyone's individual preferences; both styles have their merits! |
@davidhewitt, yeah, because I don't want to stay close to HTML hence I gave up the idea more easily. If you want to stick with HTML, in a |
@limira As @davidhewitt has said, |
html! macro uses literal strings to define texts which is quite cumbersome.
It would be HTML like if we could lift this requirement.
But to implement that we need to get location info from
Span
s ofproc-macro2
which is underprocmacro2_semver_exempt
. So, we'll need to wait on that for the time being.The text was updated successfully, but these errors were encountered: