You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/how-to/async.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
htpy fully supports rendering HTML asynchronously. Combined with a async framework such as [Starlette/FastAPI](starlette.md), the entire web request can be processed async and the HTML page can be sent to the client incrementally as soon as it is ready.
4
4
5
-
# Async components
5
+
# Writing async components
6
6
7
-
In addition to regular, [synchronous components](common-patterns.md), components can be defined as an `async def`coroutine. When rendering, htpy will `await` all async components:
7
+
Components can be defined as an `async def`function. When rendering, htpy will `await` all async components:
Copy file name to clipboardExpand all lines: docs/how-to/starlette.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,8 @@
1
-
# Usage with Starlette/FastAPI
1
+
# Starlette/FastAPI
2
2
3
-
htpy can be used with Starlette to generate HTML. Since FastAPI is built upon Starlette, htpy can also be used with FastAPI.
4
-
5
-
htpy supports full async rendering of all components. See [async rendering](async.md) for more information.
3
+
htpy works great in combination with Starlette and FastAPI. htpy supports full async rendering of all components. See [async rendering](async.md) for more information.
6
4
5
+
## Returning htpy content from a handler
7
6
To return HTML contents, use the `HtpyResponse` class:
0 commit comments