Conversation
b1045ad to
552c90b
Compare
|
I went ahead and added a suggestion for a new section in the docs, so we can get the disussion on that part rolling as well. |
|
Have you had the chance to have a look at this? |
2debf78 to
3b9548f
Compare
|
Rebased on top of 25.5.0. |
pelme
left a comment
There was a problem hiding this comment.
This looks good to me but would be happy if another @with_children user reviewed it too :)
|
Thanks for having a second look! I know that @davepeck has this on his list 😇 |
49563d9 to
29cafc1
Compare
|
Rebased after merge of #119. |
|
cc @Majsvaffla |
|
@jodal This is great! I ripped out my home-spun One thing that might be worth documenting is how to layer context consumers and from dataclasses import dataclass
import htpy as h
@dataclass(frozen=True)
class User:
name: str
email: str
USER_CONTEXT: h.Context[User | None] = h.Context("user", default=None)
@h.with_children
@USER_CONTEXT.consumer
def UserCard(user: User | None, children: h.Node, *, extra: str) -> h.Renderable:
...I don't tend to use contexts personally, but there you have it. FWIW, I think PS: Sorry it took so long to get back to this. PyCon needed extra recovery time. :-) |
As discussed in pelme#98
4836f1e to
f30f77d
Compare
4b23060 to
b279936
Compare
|
I've fixed the typo @Majsvaffla found and added a paragraph and an example about how to combine context consumers and |
|
awesome, thanks! 🙌 |
This adds the
@with_childrendecorator as discussed in #98.I've kept the implementation in a file of its own, but imported it into the
htpynamespace for easy usage.The docs have not been updated, as I wanted to get this out there for discussion and tweaks first.
TODO