Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add real world examples #7

Closed
legout opened this issue Jun 28, 2023 · 2 comments
Closed

Add real world examples #7

legout opened this issue Jun 28, 2023 · 2 comments

Comments

@legout
Copy link

legout commented Jun 28, 2023

Hi,

Adding some more advanced examples would be nice.

  • How does it play together with web frameworks like sanic, flask or fastapi?
  • How can I replace jinja2 with html5tagger
  • Does it work with htmx?

Thanks :-)

@Tronic
Copy link
Member

Tronic commented Jun 28, 2023

Sanic documentation for this is pending. But in short, you just return sanic.response.html(doc) and other frameworks probably work similarly (convert to string first if it doesn't).

Jinja2 is a more complicated matter. Rewrite all your HTML and Jinja2 loops in html5tagger and Python, remove all your escaping (as this is done automatically by html5tagger).

HTMX attributes work as usual, just use underscores instead of hyphens.

@legout
Copy link
Author

legout commented Jun 28, 2023

Great. I’ll give it a try. Thanks.

@Tronic Tronic closed this as completed Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants