Releases: pelme/htpy
25.12.0
Async rendering
htpy now supports rendering content fully asynchronous. You may use htpy with ASGI framework such as Starlette, FastAPI or Async Django to get a fully async request/response cycle.
See the async docs for more information.
Starlette response helper
To make it easy to leverage the async capabilities from Starlette, a htpy.starlette.HtpyResponse helper class is now available.
See the Starlette docs for more information.
Full Changelog: 25.10.0...25.12.0
25.10.0
What's Changed
- Raise error for invalid whitespace in class shorthand. This prevents a pitfall where specifying classes without the leading dot like
div(".foo bar"). The expected syntax isdiv(".foo.bar"). To avoid confusion, this will now raise aValueError. Thanks to @StabbarN for the fix (PR #153).
Full Changelog: 25.8.1...25.10.0
25.8.1
25.8.0
What's Changed
This release updates the list of HTML elements to match the current standard. This should provide accurate auto complete and types for builtin elements. It also adds documentation on how to use htpy and Tailwind in VS Code.
PR:s
- Add Tailwind IntelliSense configuration for VS Code by @dakixr in #147
- Update standard HTML elements. by @pelme in #149
New Contributors
Full Changelog: 25.7.0...25.8.0
25.7.0
What's Changed
This release raises an exception when rendering a generator more than once. This prevents accidentally using an exhausted generator that would previously cause invalid/unexpected results.
Full Changelog: 25.6.2...25.7.0
25.6.2
What's Changed
This release does not add any new functionality and no breakages is expected. The test/release/workflows are more automated and should make future releases less likely of breakages.
Extra big thank you to @jodal who made this happen!
Merged Pull Requests:
- Fix typo in file name by @jodal in #127
- Update examples to return
Renderablefrom custom components by @jodal in #128 - Fix inconsistent imports of
markupsafeby @jodal in #131 - Fix typos in docs by @dunderrrrrr in #133
- Build with VCS-based versioning by @jodal in #130
- Setup tox to run checks locally and in CI by @jodal in #132
- Fix .gitignore pattern for .egg-info files. by @pelme in #134
- Switch to src-layout. by @pelme in #135
- Drop the in-repo changelog, redirect to github releases. by @pelme in #136
- Add release workflow by @jodal in #129
Full Changelog: 25.5.1...25.6.0
25.5.1
- Split source code into multiple private modules. See PR #119. Thanks to Stein Magnus Jodal (@jodal).
- Add
@with_childrendecorator to help creating custom components that get passed children in the same way as regular HTML elements. See PR #113. Read the docs for more details. Thanks to Stein Magnus Jodal (@jodal).
25.5.0
25.4.2
25.4.1
- Add the
Renderableprotocol, a consistent API to render anhtpyobject as HTML or to iterate over it.Element,Fragment,ContextProvider, andContextConsumerare allRenderable. PR #92. Thanks to Stein Magnus Jodal (@jodal) and Dave Peck (@davepeck). - Deprecate
render_node()anditer_node()and direct iteration over elements. CallRenderable.__str__()orRenderable.iter_chunks()instead. Read the Usage docs for more details.