|
|
|
|
|
by j4mie
816 days ago
|
|
I wrote a library a little while ago which is intended to be the simplest possible expression of this idea: https://github.com/j4mie/hotmetal/ The core implementation is only 85 lines of Python, and has no imports at all, so works nicely on minimal/alternative Pythons like Micropython. I'm using it on a medium-sized side project and it's shockingly productive compared to string templates. I don't think anyone is using it except me, though. |
|
I've also been working on a library with a similar idea:
https://github.com/SamDudley/neat-html
It's still a work in progress so an example might be better to look at:
https://github.com/SamDudley/neat-html/blob/main/examples/fo...
I was inspired by some JavaScript libraries that I've used in the past:
- https://github.com/jorgebucaran/hyperapp
- https://github.com/hyperhype/hyperscript
There is also a working integration with Django that enables the use of neat-html as a template backend, however it isn't up on GitHub yet.
I find the space of HTML generation libraries which can leverage the power of Python, really interesting.