- How do you use quotes in your scripts?
- When do you use triple double quotes?
- What is the good practice?
Macros
For macros see: Macro Calls in WikiText
- I may recommend to ignore quotes when it is possible (e.g
<<mymac par1>>
instead of<<mymac "par1">>
) - decide to use single/double consistently ( I use
"
for strings and'
when a string with"
is passed)
Widget parameters
- when pass another widget as a parameter, use single quote. See below example
A fun example
Write a toggle button in three lines to switch the text of My Tiddler
between two values: show/hide
and properly show the button caption based on those values.
- open https://tiddlywiki.com/
- create a tiddler with below code and save
- click the button and look the
My Tiddler
<$button actions='<$action-listops $tiddler="My Tiddler" $field=text $subfilter="+[toggle[show],[hide]]"/>'>
<$list filter="[{My Tiddler}match[show]then[Hide]else[Show]]"><<currentTiddler>></$list>
</$button>
See how single '
is used instead of """
in above example