On Wednesday, June 23, 2021 at 9:17:46 AM UTC+2 [email protected] wrote:
Mini-rant: all these different syntaxes are just a tad confusing :)
> Sometimes {{..}}, sometimes {{{..}}}, sometimes <<..>>, sometimes $(..)$,
> probably others I haven't stumbled on yet. Hard to keep track.
>
We do have to do different things, that doesn't work with the same syntax.
The parser needs differences to decide what to do.
{{title}} ... is the *convenience shortcut* for <$transclude tiddler=title
/> and it produces the exact same output.
{{{ [[filter string]] }}} is the *shortcut* for <$list filter="[[filter
string]]"><$link /></$list>
-----------------
<<macro-name>> is the syntax to call a macro that has to be defined with:
\define macro-name() some text
macros do only 1 thing. They substitute text.
-----------------
\define build-url(title) https://tiddlywiki.com/#$title$
<<build-url title:"HelloThere">>
With this example the parameter that is given to the macro call, will
replace the string $title$. Then the macro output is used.
--------------------
\define build-url(title:Plugins)
[[https://tiddlywiki.com/#:$(currentTiddler)$ $(a)$ $(b)$ $title$]]
<$vars a=Learning b=Features>
<$tiddler tiddler="HelloThere">
<<build-url>>
</$tiddler>
</$vars>
The code above does a similar thing. It replaces $(currentTiddler)$ with
the variable currentTiddler, that is defined by the tiddler-widget. The
same is true for "a" and "b" ... title is from the first example
The outer [[]] is needed, to be able to uses spaces between the elements.
.. If you don't have the braces the link would need to look like this.
https://tiddlywiki.com/#:$(currentTiddler)$%20$(a)$%20$(b)$%20$title$
Hope that helps a bit
-mario
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/66918be2-5aed-495c-859f-8d92399f5285n%40googlegroups.com.