Assume you have a macro with few input parameters, and you want to display a message (passed as parameter) inside macro. What is the best practice to do this?
Example
\define myMacro(a, b, msg)
some wikitext script
...
..
You need to display the message here: $msg$
...
some more wikitext script
\end
You have different options
use text substitution $msg$
wikifying uaing <<__msg__>>
using text widget <$text text=<<__msg__>> />
using transclude widget <$transclude tiddler=<<__msg__>> field=title />
…
How do you display the message inside macro, passes as input parameter?
No. 1 … text substitution … should be avoided.
No. 2 … can be avoided for 99% of usecases … It’s very performance intensive if used in the wrong way.
No. 3 … OK if you do not need wikitext formatting.
It’s the best way to use inside a link widget, to avoid “double linking”
eg: <$link to="HelloThere"> ThisLinks to HelloThere</$link>
… If you hover ThisLinks with the mouse you’ll see what’s going on
best practice: <$link to="HelloThere"><$text text="ThisLinks to HelloThere"/></$link>
No 4 … Will be even better once “parameterized transclusions” are available
IMO the most flexible way to use text substitution in TW atm is like this.