> (I think HTML templating is a historical accident for what it's worth, and I hope it dies.)
HTML templating does have one very nice benefit though: there’s a seamless path between designing and iterating on a static HTML template (which renders in the browser) and then sprinkling in the dynamic bits on top of that.
If you start with fairly complex markup in the initial design, I’m imagining it could be tedious to rewrite the whole thing in Python. Or is there some tooling that can help with this?
FastHTML has a NotStr(X) component that renders X as HTML.
I just copied a big HTML Tailwind component to a NotStr() and it worked fine.
I then split it in two, before and after, so I could make the dynamic bit from natural FastHTML components and it worked fine returning Div(before, dynamic_parts, after).
Plan to convert most of my smaller websites to FastHTML in the next few days before it's much more enjoyable for me.
HTML templating does have one very nice benefit though: there’s a seamless path between designing and iterating on a static HTML template (which renders in the browser) and then sprinkling in the dynamic bits on top of that.
If you start with fairly complex markup in the initial design, I’m imagining it could be tedious to rewrite the whole thing in Python. Or is there some tooling that can help with this?