I am really trying to figure out what the new $slot and $fill feature is good for, and I’m struggling. Every time I try to even create a hypothetical scenario for them, I get something way more clunky than if I’d just used macros. The whole $slot and $fill stuff is so verbose. I guess that’s not a problem for the \widget definition, but it seems cumbersome to make end users use <$fill $name=“blah”>Content</$fill> every time they want to fill a slot. On top of that, if you use any slots, you must use ONLY slots, because the ts-raw
will become polluted with the others.
I thought make it might be useful if you could encapsulate the $fill somehow like this:
\widget $my.widget()
''Title:'' <$slot $name=title>Untitled</$slot>
<$slot $name=ts-raw/>
\end
\widget $my.title() <$fill $name=title><$slot $name=ts-raw>Empty</$slot></$fill>
<!-- What I have below might theoretically be useful, except it doesn't work -->
<$my.widget>
<$my.title>My Title</$my.title>
Content
</$my.widget>
But this doesn’t work. And this also shows off how tw-raw gets polluted by the contents of the $my.title widget. (Or the fill widget. Either will pollute.)
Could somebody explain to me what this feature is supposed to be elegant for?