sanic-org / html5tagger

Create HTML documents from Python
The Unlicense
29 stars 4 forks source link

Add real world examples #7

Closed legout closed 1 year ago

legout commented 1 year ago

Hi,

Adding some more advanced examples would be nice.

Thanks :-)

Tronic commented 1 year ago

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 commented 1 year ago

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