Note: An alternative skin, TW4MW (work in progress), is available from the user preferences.
Macros
TiddlyWiki Community Wiki
Macros provide commands to perform a variety of advanced functions in the place where they are called (usually within a tiddler).
A macro is normally called with the following syntax:
<<macroName [parameters]>>
In contrast to plugins, a macro's code is only executed when the respective tiddler containing the macro call is rendered.
Contents |
[edit] Parameters
Generally, there are four ways to use macro parameters:
- no quotes:
<<foo bar baz>> - single quotes:
<<foo 'bar' 'baz'>> - double quotes:
<<foo "bar" "baz">> - double brackets:
<<foo [[bar]] [[baz]]>>
Empty parameters (e.g. to adopt default value if the parameter is optional) are inserted by enclosing an empty string ('', "" or [[]]).
There's also fifth way, using curly brackets ({{...}}) - those contents are evaluated, so they're only used if the parameter value has to be calculated in some way.
[edit] Named Parameters
<<macro label:value>>
[edit] Evaluated Parameters
Parameters enclosed in {{ ... }} are processed as JavaScript code.

