volfpeter / fasthx

FastAPI server-side rendering with built-in HTMX support.
https://volfpeter.github.io/fasthx/
MIT License
458 stars 9 forks source link

Add more examples #2

Closed hasansezertasan closed 10 months ago

hasansezertasan commented 10 months ago

README.md is quite good but I think there must be a folder called "examples" for fully-fledged examples with templates folder and Jinja2 templates.

volfpeter commented 10 months ago

I think the example in the README should be enough for users who read the Jinja templating section of the FastAPI docs: https://fastapi.tiangolo.com/advanced/templates/?h=jinja#using-jinja2templates

If you submit a PR, I'll of course accept it. Or if other users request this, then I'll add two complete, working examples.

hasansezertasan commented 10 months ago

I think the example in the README should be enough for users who read the Jinja templating section of the FastAPI docs: https://fastapi.tiangolo.com/advanced/templates/?h=jinja#using-jinja2templates

I still do recommend adding it because it's a new package, introducing a new (different) perspective to the development workflow. I'm saying "new" because many FastAPI users use dependencies instead of decorators (they are not the same but still...) and the @hx and @jinja approaches looks quite unusual (to me). So seeing a full example (as a playground) before jumping into it would offer a better developer experience.

If you submit a PR, I'll of course accept it. Or if other users request this, then I'll add two complete, working examples.

I'll take a look at it.

hasansezertasan commented 10 months ago

@volfpeter I'm working on a Jinja2 example.

volfpeter commented 10 months ago

Thanks :slightly_smiling_face: