I love the idea! I could imagine something similar created for other languages too. Perhaps written in a way that a template could be reused in, let's say Django, and a JS React frontend. With all the type-safety that tsx provides.
As for Django... well.. Django only has text formatting, you can write any garbage and broken html and lots of invalid templates with silent failures there unfortunately.
I'm not a fan of Rust, the overly flexible macros are actually one reason for it, but if you can indeed get LSP support in a custom syntax like this, that's really awesome. Thank you for the example.
https://web.dev/articles/imports
Been there, tried that.
Introduced in 2014 (Chrome 36) Deprecated 2018 (Chrome 70) Retired 2019 (Chrome 73)
Why is there no direct support for templating in HTML itself?
(but yes- I used these a lot like 25 years ago)
For examples, see http://www.impredicative.com/ur/demo/
As for Django... well.. Django only has text formatting, you can write any garbage and broken html and lots of invalid templates with silent failures there unfortunately.
https://kotlinlang.org/docs/type-safe-builders.html
That's not HTML though, you have to learn a whole new dsl that must conform to rust parser rules. So, not the same thing at all.
eg
this is rsx, but there are other macros that look just like html. i prefer this though, it's much more compact and readable imo