Marks Idea of passing a list is a great one, and more elegant than this 
suggestion

However if there is a theoretical maximum you can just define it with img1 
img2... img10 and include the logic to process only the ones provided (have 
a value).

Regards
Tony

On Wednesday, November 21, 2018 at 3:36:39 PM UTC+11, Mohammad wrote:
>
> The TW macro can accept the optional parameter! An optional parameter is 
> the one you can send its value on macro call or you can ignore and macro 
> will use some default value!
> My question is can we have a macro with variable number of parameters 
> (attributes)
>
> See below macro
>
> \define mypic(caption:"no caption", img)
> <figure>
> [img[$img$]]
> <figcaption 
> style="text-align:center;font-weight:700;">$caption$</figcaption>
> </figure>
> \end
>
> I want to call mypic as below
>
> <<mypic caption img>>
>
> and
>
> <<mypic caption img1 img2 img3>>
>
>
>
> What do you think?
>
>
> I know JS has this capability, see below
>
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters
>
>
> Mohammad
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9a512fe1-53f1-4511-99e6-34e93cbff7c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to