wikitext, variables, widgets, filters, operators and the use of references variables, macros, html tags and their attributes/parameters
<<macroname [params]>>
[params] means that is optional.literal values
when literal values are used as parameters or attributes the quoting rules apply see ➃ Using literals and parameters<br>
<hr>
html tags immediate closure<section> </section>
later closure<<variable/macrocall [params]>>
immediate closure, see ➀ for later closure<$widgetname [params] />
immediate closure<$widgetname [params]> inside the widget </$widgetname>
later closure (for more see ➁ Content of widgets){{tiddlername}}
transclude the content of the tiddlername's text field and render{{!!fieldname}}
transclude the content of the currentTiddlers fieldname and render{{tiddlername!!fieldname}}
transclude the content of the tiddlername's fieldname and render{{{ [<currentTiddler>addprefix[$:/myprefix/]] }}}
filtered transclusion, see also ❻ More on filtered transclusions<variable>
"<variable>"
,[[<variable>]]
$macrocall
<$widget attribute="literal value"/>
see ➃ Using literals and parameters<$widget attribute=<<variable>>/>
using a variable<$widget attribute=<<callMacroToComputeValue>>/>
using a macro<$widget attribute={{transclusion}}/>
using a transclusion see<$widget attribute={{{ filter }}}/>
filtered transclusion ;❻<htmltag attribute="literal value"/>
see ➃ Using literals and parameters<htmltag attribute=<<variable>>/>
using a variable as a HTML attribute<htmltag attribute=<<callMacroToComputeValue>>/>
using a variable as a HTML attribute<htmltag attribute={{transclusion}}/>
using a variable as a HTML attribute see more on transclusions ❻ and ❼<htmltag attribute={{{ filter }}}/>
filtered transclusion ;❻{{!!transclusion}}
a field who's value can also be inside [[ ]]
????<$widget attribute="prefix-<<variable>>"/>
<$widget attribute=[[prefix-<<variable>>]]/>
<$widget attribute="prefix-{{transclusion}}"/>
\define macrocname(parms) In here
\define macrocname(parms) here
and in here
\end
$macroParameter$
, "$macroParameter$"
, [[$macroParameter$]]
<<__macroParameter__>>
$(variable)$
references a variable from the context of the calling macro, this is away to avoid the use of a parameter in macrocalls.<<__macroParameter__>>
Parameter-as-variable access to a parameter defined in the macro parameters list as it it were a variable.<$widget attribute="prefix-$macroParameter$"/>
<$widget attribute=$macroParameter$/>
unsafe when $macroParameter$ has spaces or other special characters.$variable$
, "$variable$"
, [[$variable$]]
<<macroname "1st" "2nd">>
refers to Nth parameter in macro definition<<macroname param:"value">>
refers to the name parameter<<macroname param:"$macroParameter$">>
only inside macro were $param$ and $(varname)$ are valid see<$macrocall $name=macroname param="literal" param1=<<variable>> param2={{transclusion}} param3={{{ filter }}} />
<<macroname <<variable>> >>
<<
and >>
get confused<<macroname "<<variable>>" >>
<<variable>>
?? the <<
and >>
get confused ??<<macroname param:<<variable>> >>
<<
and >>
get confused<<macroname {{transclusion}}>>
<<macroname param:{{transclusion}}>>
[]
you would have needed. So an operator[literalvalue]
becomes operator<varname>
[operator<variable>]
(no inner square brackets!)[operator{transclusion}]
only single curly brackets![operator{!!fieldname}]
only single curly brackets![operator{tiddlername!!fieldname}]
only single curly brackets!operator[$macroParameter$]
(only filters within macros)[operator[$(variable)$]]
[operator<macroname parameter>]
filter={{tiddlername}}
filter={!!fieldname}}
filter={{tiddlername!!fieldname}}
filter="{{tiddlername}}addprefix[$:/]]
<$wikify name=newvar text="""<<macroname parameter>>""">
... [operator<newvar>] ....
</$wikify>
{{{ filter }}}
they excel in particular uses such as concatenation, evaluation, maths and as parameter to widget especially the $macrocall widget.{{{ somename }}}
somename a tiddler link{{{ some name }}}
somename two tiddler links{{{ [[some name]] }}}
some name tiddler whos title contains spaces{{{ [[somename]get[caption]else{!!title}] }}}
caption of somename tiddler whos title contains spaces'<$text text={{{ [[somename]get[caption]else{!!title}] }}}/>'
'caption of somename' use text so the caption does not become a linkrather that containing something which is later evaluated at render time)
<$wikify name=result text="""{{{ [[somename]get[caption]else{!!title}] }}} >
The <<result>> variable containes the result of the wikify only before its closure
</$wikify>
"tiddlername"
, "!!fieldname"
or "tiddlername!!fieldname"
these are "references"{{||tiddlername!!caption}}
as it aske for the field caption in tiddlername, but insists on using the currentTiddler.<<variable
[params]
>>
<$text>
widget is not used.<$widgetname [params]> inside the widget </$widgetname>
later closure<$widgetname [params]>
inside the widget
</$widgetname>
<$macrocall>
widget is ignored. So we can use it as such;<¯ocall $name=macroname param="literal" param1=<<variable>> param2={{transclusion}} param3={{{ filter }}} >
So in here we could document the function and parameters of this particular macrocall
/>
\define concatenate-parameters(param1 param2) $param1$/$param2$
\define concatenate-variables() $(currentTiddler)$/$(subtiddler)$
<<concatenate-parameters tiddlername subtiddler>>
<$set name=subtiddler value="mysubtiddler">
<<concatenate-variables>>
</$set>
'
single quotes'
, "
double quotes"
, """
triple double quotes"""
or [[
double square brackets]]
.' or " or """
if you want to wrap something that contains (or may contain) one of the other quotes. In this regard the """literal"""
is the safest.""
are not used to delimit''
are used to open and close bold in wiki text."""
is used to mark a block of text.this is between single back ticks
and will not be rendered.'<<macroname>>'
"<<macroname>>"
"""<<macroname>>"""
it turns it into a literalHowever when we use the following as a parameter or attribute value they are already delimited by the <<
or {{
or {{{
so no need to add quotes and turn them into literals.
parname=<<macroname>>
parname=<<varname>>
parname={{{ [filter] }}}
parname={{!!fieldname}}
parname={{tiddlername}}
parname={{tiddlername!!fieldname}}
But in the above cases the value is retrieved from elsewhere, and that value needs to be appropriate for the parameter you are providing.
<div></div>
etc... are permitted in wiki text, So we need <<
to separate them from <
only singles are required in filters, because filters do not handle html tags.Folks,I have being building a "CheatSheet" that I would appreciate expert review if possible. Please respond with references to the number of each item.You can see it is built on Tobias and Eric's work to name a few. It tries and make simple, some particularly tricky issues that new and experienced users face.
FYI, the solution using join[] (or addsuffix[]) is substantially faster...
Just as {{||template}} is not supported as a widget attribute, {{{filter||template}}} is not supported for filtered attributes.I am not so sure about this statement. I understood the template pre-processes the result then delivers the value(s) to the attribute. I will look more closely.