This is a stripped-down version of a single section of Grok TiddlyWiki, optimized for fast loading and readability by search engines. Some features are missing.

For the full Grok TiddlyWiki experience, please visit the wiki version of this page.

Summary of Macro and Transclusion Syntax

10th April 2021 at 9:37am

We learned about a lot of different ways of reusing and relating content in TiddlyWiki in this chapter, and when you've just learned all of them, it's often difficult to keep them straight. Let's review all the options and the syntax for each.

You can find a condensed version of this section in the Wikitext Reference, which also has some live examples you can play with.

Available in wikitext and filter expressions

The following types of references work both within wikitext and filter expressions. In filter expressions, you use only one of each type of bracket. In wikitext, you use two.

[[square brackets]]
To link or refer to the title of a tiddler.
<<angle brackets>>
To get the value of a variable or call a macro.
{{curly braces}}
To transclude the value of a field of a tiddler.
  • {{tiddler}} to transclude the text field of a tiddler
  • {{tiddler!!field}} to transclude a different field of a tiddler
  • {{!!field}} to transclude a field of the current tiddler
  • {{tiddler##index}} to transclude a property of a data tiddler (we'll learn about data tiddlers in chapter 5)
  • {{tiddler||Template}} to transclude a tiddler through a template
  • {{||Template}} to transclude the current tiddler through a template

Available only within wikitext

{{{ triple curly braces }}}
Select one or more tiddlers using a filter, then transclude them. You can think of this as the “super” or “extra powerful” version of normal double-brace transclusion, since it has one extra brace.

As you might have worked out from the heading “Available only within wikitext”, this form is not available inside another filter expression; if you need to nest filter expressions this way, store the results of the inner filter expression in a variable and then transclude the value of that variable into the outer filter expression.

Available only within macros

Some extra syntax for variables and parameters is available within macro definitions, whether you're within a filter expression inside the macro definition or not:

  • <<angle brackets>> refer to a variable without text substitution. (This is the same standard syntax available outside a macro and is included here for comparison with the following three items.)
  • $(parenthesized dollar signs)$ refer to a variable using text substitution.
  • <<__angle brackets with underscores__>> refer to a parameter of the macro without text substitution. Inside a filter expression, use <__single angle brackets but double underscores__>.
  • $dollar signs$ refer to a parameter of the macro using text substitution.

Neither the <<variable>> nor the <<__parameter__>> syntax works if the contents of your macro will not be wikified where you intend to call it, for instance because you are providing it as an attribute of a widget or HTML tag; the text-substitution-based forms must be used in that case.

↑ 4: Variables, Macros, and Transclusions