On Friday, September 11, 2020 at 12:18:15 AM UTC-7, Tejasvi S Tomar wrote:
>
> Is there a way to specify an arbitrary number of parameters in the macro
> definition? My use case is to pass the tiddler name without using quotes.
> More specifically, in http://tobibeer.github.io/tw5-plugins/#inc, I want
> be able to transclude by <<{ Tiddler name>> which currently requires
> quoting, like <<{ "Tiddler name">>.
>
When you pass arguments to a macro, the spaces define separate arguments.
Thus:
<<someMacro this is a test>>
has 4 arguments, "this", "is", "a", and "test"
However, if you want to treat them all as one big argument, you can
re-combine them in the macro itself, like this:
\define someMacro(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
<$vars arg={{{ [[$arg1$ $arg2$ $arg3$ $arg4$ $arg5$ $arg6$ $arg7$ $arg8$
$arg9$]trim[]] }}}>
...
\end
The $vars concatenates all the individual args into one long
space-separated string and strips off any excess trailing spaces if the
number of args passed in was less than 9
-e
--
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/dfa99538-1e68-4784-bdab-d77c7b921316o%40googlegroups.com.