This page is part of a static HTML representation of the TiddlyWiki at http://tiddlywiki.com/

MacroCallWidget

30th October 2013 at 8:37am
Widgets

Introduction

The macro call widget provides an alternative syntax for invoking macros. The advantage of the widget form is that it allows macro parameters to be specified as widget attributes, thus allowing indirection and macro values to be set.

For example, a macro called italicise that takes a single parameter called text can be invoked in any of these ways:

<<italicise "Text to be made into italics">>
<<italicise text:"Text to be made into italics">>
<$macrocall $name="italicise" text="Text to be made into italics"/>
<$macrocall $name="italicise" text={{Title of tiddler containing text to be italicised}}/>
<$macrocall $name="italicise" text=<<textMaker "Another macro to generate the text to be italicised">>/>

You can see several examples of the macro call widget within the core:

Content and Attributes

The content of the <$macrocall> widget is ignored.

AttributeDescription
$nameName of the macro to invoke
$typeContentType with which the macro text should be parsed (defaults to text/vnd.tiddlywiki)
$outputContentType for the output rendering (defaults to text/html, can also be text/plain)
parametersMacro parameters specified as attributes