4 ms·
Until you try it out and realize the benefits! - Type safe HTML: you get an exception instead of malformed HTML - Truly reusable components: any Python web fr
by kissgyorgy 3y ago
Until you try it out and realize the benefits!
- Type safe HTML: you get an exception instead of malformed HTML
- Truly reusable components: any Python web framework, component packages are truly reusable in any other projects. I never seen this with template engines.
- Huge productivity boost: not even close! No hunting for templates, no jumping between files, everything is in Python functions.
- Composable elements: you can nest things as much as you want, refactor very easily. Doing this with templates is not even possible, or such a pain I never did it.
- Storybook: There are a couple ones for Django, but they are clunky and not reusable at all.
I felt the same for a long time, but started thinking about a nice API. It took me months, but I finally got it: https://github.com/kissgyorgy/compone https://github.com/kissgyorgy/compone
- grrandalf 3y agoInsightful summary. Thx.
- mixmastamyk 3y agoYes, I quite like the idea of being able to run pyflakes/flake8/black/pytest/mypy over my "html templates", and benefiting from all the power that entails.
- Ringz 3y agoTry ruff [0] and get rid of flake and black [0]: https://github.com/astral-sh/ruff https://github.com/astral-sh/ruff
- mixmastamyk 3y agoI'm aware of it, but it obscures functionality for my previous statement.