Example: how to use Snippet with Slots to make the best use of both HTML and Python #40
volfpeter
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Slot support arrived in version 0.5.0 for both the
Snippet
andMD
components, but there was no proper example in the documentation on how to use this new feature. Finally, there is, in the form of a tinyFastAPI
app that uses a mix of plain HTML,Snippet
,Slots
, and "classic"htmy
components to render a page. The example usesFastHX
to automate rendering.Example: https://volfpeter.github.io/htmy/examples/snippet-slots-fastapi/
FastHX
integration example forhtmy
: https://volfpeter.github.io/fasthx/examples/htmy/There's a lot more
Snippet
andMD
can do with theirTextResolver
andTextProcessor
abstractions, and their text processing pipeline. Hopefully I'll have time to add more complex examples in the not too distant features. In the meantime, feel free to ask questions.Beta Was this translation helpful? Give feedback.
All reactions