This macro works perfectly; however it is used so frequently in many tiddler in the story river that I am now consciously questioning its efficiency.
\define myMacro(var)
<$list filter="[<_var_>!is[blank]]">
<$button>myButton</$button>
</$list>
\end
<<myMacro>> => there should be no button.
<<myMacro param>> => the button appears and reveals the content.
Is that an elegant solution?
I have some concerns because it is said that the listWidget consumes a lot of processing power, so there might be better approaches, perhaps using the revealWidget. I often wonder whether there are more efficient ways to solve a given task. For example, I was “surprised” by a comment from Eric Shulman, who gave me the following tip, which has helped me write much more efficient macros that no longer waste processing power and slow down input.
Since then, I have been wondering whether there are more such “traps” – or rather, useful tips – for programming TiddlyWiki-Script.
Best
g.eron