-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Say I have something like this:
(defsnippet Container "template.html" [:.container]
[data]
{[:.widget1 :.foo] (content "foo")
[:.widget1 :.bar] (content "bar")
[:.widget2 :.foo] (content "foo")
[:.widget2 :.bar] (content "bar")})Is there a way to factor out the common elements? Something like this, perhaps?
(def selector-fragment
{[:.foo] (content "foo")
[:.bar] (content "bar")})
(defsnippet Container "template.html" [:.container]
[data]
{[:.widget1] (selector-fragment)
[:.widget2] (selector-fragment)})I don't care about the syntax, but I can't figure out any way to get this kind of composition/abstraction without hacking Kioo itself.
- If I do the composition in "transform" position, on the right hand side, I can't do any more selecting because selection is unavailable at runtime.
- I can't compose on the left hand side, in the selector position, because evaluation of that is controlled exclusively by the Kioo macro.
Any ideas on how this might be supported?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels