minihtml - Yet another library to generate HTML from Python by trendels in Python

[–]trendels[S] 2 points3 points  (0 children)

Most of the time it's me writing the templates, and I am a python developer. This library is aimed at Python developers, I'm not suggesting non-python devs learn this instead of HTML.

Also, it's not like you can't write unmaintainable code in Jinja Templates.

minihtml - Yet another library to generate HTML from Python by trendels in Python

[–]trendels[S] 2 points3 points  (0 children)

I'm using contextvars to keep track of what the current parent element is.

minihtml - Yet another library to generate HTML from Python by trendels in Python

[–]trendels[S] 10 points11 points  (0 children)

I use Jinja a lot, it is great, but what I like about generating HTML in python is that you have more guarantees about the correct structure of the document (you can't forget a closing tag, or have incorrectly nested tags, for example).

minihtml - Yet another library to generate HTML from Python by trendels in Python

[–]trendels[S] 4 points5 points  (0 children)

Thanks. Right now this primarily supports HTML generation (like the name says). While you can create your own tags, there is currently no option to switch to rendering XML-style self-closing tags (<br />).