Skip to Content Skip to Navigation
Login

A few weeks ago I open sourced a tiny library I’ve been noodling on for a while: github.com/j4mie/hotmetal

It’s for generating HTML from basic Python data structures. It’s a bit weird and most people will probably hate it (which is fine). But I’ve now built a moderately complicated web app with it and I’m never going back to string-based templates!

Oh, and it runs quite happily under MicroPython on a ~£4 microcontroller, which is fun.

Edited 46d ago

@jamie 🎉 Congrats. hotmetal is shiny. I'm a fan of these libraries because they are nice for the occasional itch.

It kind of reminds me of github.com/adamchainz/h which is worth pointing out on the off chance there's something useful there since it's archived.

@jamie nice. It looks exactly like Elm, which mean it’s on the right track. You’re gonna have to stop turning these things out, or I’m going to have to start a fan club 😜

@jamie that name brought back memories…

en.wikipedia.org/wiki/HoTMetaL

@ulope glad someone got the reference! I was an avid user before I figured out that all I needed was Notepad

@carlton interesting... I can see the similarities! I always liked the look of Elm but I've never tried it. No need for a fan club here, particularly compared to the contributions you make to Django and the universe in general.

@webology huh, I’d found a few libraries like that but didn’t realise @adamchainz made one!

One nice thing about manipulating tuples directly (rather than wrapping tags in functions and using kwargs for attrs) is that you don’t have to worry about that kinda janky class_ thing 😆 just do {“class”: “whatever”}

@jamie @webology Yeah mine was just an experiment.

Nice idea to use plain data structures, should keep it fast.

Type hints could help make this a bit more ergonomic.