[tw5] Re: Macro with variable number of arguments

2020-04-20 Thread TonyM
I will add to mats reference a less known 
storyTiddler https://tiddlywiki.com/prerelease/#storyTiddler%20Variable

Regards
Tony

On Monday, 20 April 2020 23:47:16 UTC+10, Mat wrote:
>
> MaxGyver wrote:
>>
>> Why do you use *currentTiddler* as variable?
>>
>
> See docs 
> 
> .
>
> <:-) 
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9f1eb957-04bc-4922-8166-a0b70e7ca1db%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-20 Thread Mat
MaxGyver wrote:
>
> Why do you use *currentTiddler* as variable?
>

See docs 

.

<:-) 

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/05ecfd81-5d72-424a-9496-e0fc04df4864%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-20 Thread TonyM
Max

I write as many of my macros I can using current tiddler so they can be used in 
different ways and depend on less parameters. 

When you generate a list in a filter they are considered tiddler titles and use 
current Tiddler unless you set variable=varname.

Macros based on current tiddler are often valid in others lists.

Regards
Tony

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/79a271e1-b961-43dd-886f-503206dafc6e%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-20 Thread TonyM
Max

An increasing number know it well, everyone in this thread are arguably 
experts. Its beauty is its flexibility. In reality macros are a very simple 
extensions of wiki text and widgets. Although its strength is in filters but 
these are very powerful and needs new concepts for many.

Those who have taken this journey and the gurus are paving the way for the next 
generation through support and development.

Enjoy the virtuose circle.

Regards
Tony

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/642c7274-776d-484c-9c93-647b922bbf61%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-20 Thread MaxGyver
Thanks, Tony!

I'm wondering how many people on earth really understand the TiddlyWiki 
macro language :-)

Why do you use *currentTiddler* as variable?

Am Montag, 20. April 2020 04:58:53 UTC+2 schrieb TonyM:
>
> Updated
>
> New Macro name and a button one as well
>
> \define kbd(string delim:" " sep:"+")
> <$list filter="[[$string$]split[$delim$]first[]]">< >>
> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <<
> currentTiddler>>
> \end
> \define dummy-button(string delim:" " sep:" ")
> <$list filter="[[$string$]split[$delim$]first[]]"><$button 
> tooltip="demonstration 
> button only"><>
> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <$button 
> tooltip="demonstration 
> button only"><>
> \end
>
> <> <>
>
>
> <> 
> <" >>
> <>
> <>
>
>
> <>
> <>
> <" >>
> <>
> <>
>
>
> On Monday, April 20, 2020 at 10:41:12 AM UTC+10, TonyM wrote:
>>
>> Max,
>>
>> Personally I have a different approach to this; and it is more general in 
>> use. Paste this onto Tiddlywiki.com
>>
>>- If you are only making use of space delimiters anyway, do it 
>>yourself in a single parameter
>>- This below defaults to space delimiter and + separator as you wish
>>- By using comma you can do the same for multiple words
>>- By using "/" you can make a system tiddler easier to read
>>
>>
>> \define keys(string delim:" " sep:"+")
>> <$list filter="[[$string$]split[$delim$]first[]]"><> >>
>> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <<
>> currentTiddler>>
>> \end
>>
>> <>
>> <>
>> <" >>
>> <>
>> <>
>>
>> Need any more features?
>>
>> Regards
>> Tony
>>
>> On Monday, April 20, 2020 at 1:05:31 AM UTC+10, MaxGyver wrote:
>>>
>>> Hi all,
>>>
>>> I often use the *kbd* tag for showing (keyboard) keys in my TiddlyWiki, 
>>> like that:
>>>
>>> Ctrl+Shift+A
>>>
>>> Typing this a lot is no fun, so I made a macro:
>>>
>>> \define key(text: "Shift") $text$
>>>
>>> It can be used this way:
>>>
>>> <>
>>>
>>> Now I could call this macro two or three times for creating a key 
>>> combination. But it's even easier with additional macros:
>>>
>>> \define combo2(key1: "Ctrl", key2: "x") $key1$+$key2$>> kbd>
>>>
>>> \define combo3(key1: "Ctrl", key2: "Shift", key3: "x") $key1$<
>>> /kbd>+$key2$+$key3$
>>>
>>> So I can write:
>>>
>>> <>
>>>
>>> which generates the key combination of my example at top.
>>>
>>> Just for curiosity:
>>> Is is possible to create a single macro that works for either one, two 
>>> or three keys? 
>>>
>>> Best regards,
>>> Max
>>>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7eca77f8-8805-4475-a7d5-ff38ae823b5a%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-19 Thread Mohammad
Thanks Tony!
I make some modification on these normally!

On Monday, April 20, 2020 at 8:40:09 AM UTC+4:30, TonyM wrote:
>
> Mohammad,
>
> I was thinking of you when writing this, perhaps adding your Shiraz colour 
> options. Feel free to pillage :)
>
> Regards
> Tony
>
> On Monday, April 20, 2020 at 2:07:36 PM UTC+10, Mohammad wrote:
>>
>> Great solution Tony!
>> Added to TW-Scripts.
>>
>> On Monday, April 20, 2020 at 7:28:53 AM UTC+4:30, TonyM wrote:
>>>
>>> Updated
>>>
>>> New Macro name and a button one as well
>>>
>>> \define kbd(string delim:" " sep:"+")
>>> <$list filter="[[$string$]split[$delim$]first[]]"><>> >>
>>> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <<
>>> currentTiddler>>
>>> \end
>>> \define dummy-button(string delim:" " sep:" ")
>>> <$list filter="[[$string$]split[$delim$]first[]]"><$button 
>>> tooltip="demonstration 
>>> button only"><>
>>> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <$button tooltip
>>> ="demonstration button only"><>
>>> \end
>>>
>>> <> <>
>>>
>>>
>>> <> 
>>> <" >>
>>> <>
>>> <>
>>>
>>>
>>> <>
>>> <>
>>> <" >>
>>> <>
>>> <>
>>>
>>>
>>> On Monday, April 20, 2020 at 10:41:12 AM UTC+10, TonyM wrote:

 Max,

 Personally I have a different approach to this; and it is more general 
 in use. Paste this onto Tiddlywiki.com

- If you are only making use of space delimiters anyway, do it 
yourself in a single parameter
- This below defaults to space delimiter and + separator as you wish
- By using comma you can do the same for multiple words
- By using "/" you can make a system tiddler easier to read


 \define keys(string delim:" " sep:"+")
 <$list filter="[[$string$]split[$delim$]first[]]"><>>> >>
 <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <<
 currentTiddler>>
 \end

 <>
 <>
 <" >>
 <>
 <>

 Need any more features?

 Regards
 Tony

 On Monday, April 20, 2020 at 1:05:31 AM UTC+10, MaxGyver wrote:
>
> Hi all,
>
> I often use the *kbd* tag for showing (keyboard) keys in my 
> TiddlyWiki, like that:
>
> Ctrl+Shift+A
>
> Typing this a lot is no fun, so I made a macro:
>
> \define key(text: "Shift") $text$
>
> It can be used this way:
>
> <>
>
> Now I could call this macro two or three times for creating a key 
> combination. But it's even easier with additional macros:
>
> \define combo2(key1: "Ctrl", key2: "x") $key1$<
> /kbd>+$key2$
>
> \define combo3(key1: "Ctrl", key2: "Shift", key3: "x") $key1$<
> /kbd>+$key2$+$key3$
>
> So I can write:
>
> <>
>
> which generates the key combination of my example at top.
>
> Just for curiosity:
> Is is possible to create a single macro that works for either one, two 
> or three keys? 
>
> Best regards,
> Max
>


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/1bed28c8-f079-4fd4-9d69-e1c43844d181%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-19 Thread TonyM
Mohammad,

I was thinking of you when writing this, perhaps adding your Shiraz colour 
options. Feel free to pillage :)

Regards
Tony

On Monday, April 20, 2020 at 2:07:36 PM UTC+10, Mohammad wrote:
>
> Great solution Tony!
> Added to TW-Scripts.
>
> On Monday, April 20, 2020 at 7:28:53 AM UTC+4:30, TonyM wrote:
>>
>> Updated
>>
>> New Macro name and a button one as well
>>
>> \define kbd(string delim:" " sep:"+")
>> <$list filter="[[$string$]split[$delim$]first[]]"><> >>
>> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <<
>> currentTiddler>>
>> \end
>> \define dummy-button(string delim:" " sep:" ")
>> <$list filter="[[$string$]split[$delim$]first[]]"><$button 
>> tooltip="demonstration 
>> button only"><>
>> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <$button 
>> tooltip="demonstration 
>> button only"><>
>> \end
>>
>> <> <>
>>
>>
>> <> 
>> <" >>
>> <>
>> <>
>>
>>
>> <>
>> <>
>> <" >>
>> <>
>> <>
>>
>>
>> On Monday, April 20, 2020 at 10:41:12 AM UTC+10, TonyM wrote:
>>>
>>> Max,
>>>
>>> Personally I have a different approach to this; and it is more general 
>>> in use. Paste this onto Tiddlywiki.com
>>>
>>>- If you are only making use of space delimiters anyway, do it 
>>>yourself in a single parameter
>>>- This below defaults to space delimiter and + separator as you wish
>>>- By using comma you can do the same for multiple words
>>>- By using "/" you can make a system tiddler easier to read
>>>
>>>
>>> \define keys(string delim:" " sep:"+")
>>> <$list filter="[[$string$]split[$delim$]first[]]"><>> >>
>>> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <<
>>> currentTiddler>>
>>> \end
>>>
>>> <>
>>> <>
>>> <" >>
>>> <>
>>> <>
>>>
>>> Need any more features?
>>>
>>> Regards
>>> Tony
>>>
>>> On Monday, April 20, 2020 at 1:05:31 AM UTC+10, MaxGyver wrote:

 Hi all,

 I often use the *kbd* tag for showing (keyboard) keys in my 
 TiddlyWiki, like that:

 Ctrl+Shift+A

 Typing this a lot is no fun, so I made a macro:

 \define key(text: "Shift") $text$

 It can be used this way:

 <>

 Now I could call this macro two or three times for creating a key 
 combination. But it's even easier with additional macros:

 \define combo2(key1: "Ctrl", key2: "x") $key1$+$key2$>>> kbd>

 \define combo3(key1: "Ctrl", key2: "Shift", key3: "x") $key1$<
 /kbd>+$key2$+$key3$

 So I can write:

 <>

 which generates the key combination of my example at top.

 Just for curiosity:
 Is is possible to create a single macro that works for either one, two 
 or three keys? 

 Best regards,
 Max

>>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e9b977be-606b-40f9-a6c9-caa7070034ad%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-19 Thread Mohammad
Great solution Tony!
Added to TW-Scripts.

On Monday, April 20, 2020 at 7:28:53 AM UTC+4:30, TonyM wrote:
>
> Updated
>
> New Macro name and a button one as well
>
> \define kbd(string delim:" " sep:"+")
> <$list filter="[[$string$]split[$delim$]first[]]">< >>
> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <<
> currentTiddler>>
> \end
> \define dummy-button(string delim:" " sep:" ")
> <$list filter="[[$string$]split[$delim$]first[]]"><$button 
> tooltip="demonstration 
> button only"><>
> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <$button 
> tooltip="demonstration 
> button only"><>
> \end
>
> <> <>
>
>
> <> 
> <" >>
> <>
> <>
>
>
> <>
> <>
> <" >>
> <>
> <>
>
>
> On Monday, April 20, 2020 at 10:41:12 AM UTC+10, TonyM wrote:
>>
>> Max,
>>
>> Personally I have a different approach to this; and it is more general in 
>> use. Paste this onto Tiddlywiki.com
>>
>>- If you are only making use of space delimiters anyway, do it 
>>yourself in a single parameter
>>- This below defaults to space delimiter and + separator as you wish
>>- By using comma you can do the same for multiple words
>>- By using "/" you can make a system tiddler easier to read
>>
>>
>> \define keys(string delim:" " sep:"+")
>> <$list filter="[[$string$]split[$delim$]first[]]"><> >>
>> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <<
>> currentTiddler>>
>> \end
>>
>> <>
>> <>
>> <" >>
>> <>
>> <>
>>
>> Need any more features?
>>
>> Regards
>> Tony
>>
>> On Monday, April 20, 2020 at 1:05:31 AM UTC+10, MaxGyver wrote:
>>>
>>> Hi all,
>>>
>>> I often use the *kbd* tag for showing (keyboard) keys in my TiddlyWiki, 
>>> like that:
>>>
>>> Ctrl+Shift+A
>>>
>>> Typing this a lot is no fun, so I made a macro:
>>>
>>> \define key(text: "Shift") $text$
>>>
>>> It can be used this way:
>>>
>>> <>
>>>
>>> Now I could call this macro two or three times for creating a key 
>>> combination. But it's even easier with additional macros:
>>>
>>> \define combo2(key1: "Ctrl", key2: "x") $key1$+$key2$>> kbd>
>>>
>>> \define combo3(key1: "Ctrl", key2: "Shift", key3: "x") $key1$<
>>> /kbd>+$key2$+$key3$
>>>
>>> So I can write:
>>>
>>> <>
>>>
>>> which generates the key combination of my example at top.
>>>
>>> Just for curiosity:
>>> Is is possible to create a single macro that works for either one, two 
>>> or three keys? 
>>>
>>> Best regards,
>>> Max
>>>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/993064ab-4c55-4c65-8784-8aaeef0ebf45%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-19 Thread TonyM
Updated

New Macro name and a button one as well

\define kbd(string delim:" " sep:"+")
<$list filter="[[$string$]split[$delim$]first[]]"><>
<$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <<
currentTiddler>>
\end
\define dummy-button(string delim:" " sep:" ")
<$list filter="[[$string$]split[$delim$]first[]]"><$button 
tooltip="demonstration 
button only"><>
<$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <$button 
tooltip="demonstration 
button only"><>
\end

<> <>


<> 
<" >>
<>
<>


<>
<>
<" >>
<>
<>


On Monday, April 20, 2020 at 10:41:12 AM UTC+10, TonyM wrote:
>
> Max,
>
> Personally I have a different approach to this; and it is more general in 
> use. Paste this onto Tiddlywiki.com
>
>- If you are only making use of space delimiters anyway, do it 
>yourself in a single parameter
>- This below defaults to space delimiter and + separator as you wish
>- By using comma you can do the same for multiple words
>- By using "/" you can make a system tiddler easier to read
>
>
> \define keys(string delim:" " sep:"+")
> <$list filter="[[$string$]split[$delim$]first[]]">< >>
> <$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <<
> currentTiddler>>
> \end
>
> <>
> <>
> <" >>
> <>
> <>
>
> Need any more features?
>
> Regards
> Tony
>
> On Monday, April 20, 2020 at 1:05:31 AM UTC+10, MaxGyver wrote:
>>
>> Hi all,
>>
>> I often use the *kbd* tag for showing (keyboard) keys in my TiddlyWiki, 
>> like that:
>>
>> Ctrl+Shift+A
>>
>> Typing this a lot is no fun, so I made a macro:
>>
>> \define key(text: "Shift") $text$
>>
>> It can be used this way:
>>
>> <>
>>
>> Now I could call this macro two or three times for creating a key 
>> combination. But it's even easier with additional macros:
>>
>> \define combo2(key1: "Ctrl", key2: "x") $key1$+$key2$> kbd>
>>
>> \define combo3(key1: "Ctrl", key2: "Shift", key3: "x") $key1$<
>> /kbd>+$key2$+$key3$
>>
>> So I can write:
>>
>> <>
>>
>> which generates the key combination of my example at top.
>>
>> Just for curiosity:
>> Is is possible to create a single macro that works for either one, two or 
>> three keys? 
>>
>> Best regards,
>> Max
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0d2d6c02-f5b9-4aff-a1ad-2af2d768a71b%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-19 Thread TonyM
Max,

Personally I have a different approach to this; and it is more general in 
use. Paste this onto Tiddlywiki.com

   - If you are only making use of space delimiters anyway, do it yourself 
   in a single parameter
   - This below defaults to space delimiter and + separator as you wish
   - By using comma you can do the same for multiple words
   - By using "/" you can make a system tiddler easier to read


\define keys(string delim:" " sep:"+")
<$list filter="[[$string$]split[$delim$]first[]]"><>
<$list filter="[[$string$]split[$delim$]rest[]]"> $sep$ <<
currentTiddler>>
\end

<>
<>
<" >>
<>
<>

Need any more features?

Regards
Tony

On Monday, April 20, 2020 at 1:05:31 AM UTC+10, MaxGyver wrote:
>
> Hi all,
>
> I often use the *kbd* tag for showing (keyboard) keys in my TiddlyWiki, 
> like that:
>
> Ctrl+Shift+A
>
> Typing this a lot is no fun, so I made a macro:
>
> \define key(text: "Shift") $text$
>
> It can be used this way:
>
> <>
>
> Now I could call this macro two or three times for creating a key 
> combination. But it's even easier with additional macros:
>
> \define combo2(key1: "Ctrl", key2: "x") $key1$+$key2$ >
>
> \define combo3(key1: "Ctrl", key2: "Shift", key3: "x") $key1$<
> /kbd>+$key2$+$key3$
>
> So I can write:
>
> <>
>
> which generates the key combination of my example at top.
>
> Just for curiosity:
> Is is possible to create a single macro that works for either one, two or 
> three keys? 
>
> Best regards,
> Max
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8bcfadcf-1fda-42d9-9eee-21b67a28e0ba%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-19 Thread MaxGyver
@Mat: Thanks for your reply! Yes, I know that I can pass empty strings as 
arguments but I don't want to end up with empty keys. And I had no idea how 
to skip a key if an empty string was given.

@Eric: Awesome! This works perfectly. Thank you!


Am Sonntag, 19. April 2020 17:24:54 UTC+2 schrieb Eric Shulman:
>
> On Sunday, April 19, 2020 at 8:05:31 AM UTC-7, MaxGyver wrote:
>>
>> I often use the *kbd* tag for showing (keyboard) keys in my TiddlyWiki, 
>> like that:
>> \define combo3(key1: "Ctrl", key2: "Shift", key3: "x") $key1$<
>> /kbd>+$key2$+$key3$
>> So I can write:
>> <>
>> Is is possible to create a single macro that works for either one, two or 
>> three keys? 
>>
>
> This will do what you want:
> \define key(key1,key2,key3)
> \whitespace trim
> $key1$
> <$reveal text="$key2$" type="nomatch" default="">+$key2$ $reveal>
> <$reveal text="$key3$" type="nomatch" default="">+$key3$ $reveal>
> \end
>
> With the above macro, you can then write any of the following
> <>
> <>
> <>
>
> Note: The <$reveal> widget usually takes a "state" parameter, which is the 
> name of a tiddler containing a text field with the value to compare.  By 
> omitting the "state" parameter, and using the "default" parameter instead, 
> you can use $reveal to compare two literal values, without needs a tiddler 
> in which to store a state value.
>
> enjoy,
> -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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/08ec3250-4758-4240-be94-92b4ae7cb244%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-19 Thread Eric Shulman
On Sunday, April 19, 2020 at 8:05:31 AM UTC-7, MaxGyver wrote:
>
> I often use the *kbd* tag for showing (keyboard) keys in my TiddlyWiki, 
> like that:
> \define combo3(key1: "Ctrl", key2: "Shift", key3: "x") $key1$<
> /kbd>+$key2$+$key3$
> So I can write:
> <>
> Is is possible to create a single macro that works for either one, two or 
> three keys? 
>

This will do what you want:
\define showkey(key1,key2,key3)
\whitespace trim
$key1$
<$reveal text="$key2$" type="nomatch" default="">+$key2$
<$reveal text="$key3$" type="nomatch" default="">+$key3$
\end

With the above macro, you can then write any of the following
<>
<>
<>

Note: The <$reveal> widget usually takes a "state" parameter, which is the 
name of a tiddler containing a text field with the value to compare.  By 
omitting the "state" parameter, and using the "default" parameter instead, 
you can use $reveal to compare two literal values, without needs a tiddler 
in which to store a state value.

enjoy,
-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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b27cf735-69c6-455e-90bd-3219cc01feed%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-19 Thread Mat


On Sunday, April 19, 2020 at 5:13:25 PM UTC+2, Mat wrote:
>
> Macros themselves don't require that all arguments are actually used. If 
> all are needed depends only on the logic that you create inside the macro. 
>
> \define foo(bar, baz) $bar$ and $baz$
>
> <> ---> YO and
>
> However be careful because the first argument that you put in the 
> macrocall is interpreted as the first parameter. So you must either specify 
> which parameter:
>
> <> -> and YO
>
> (in this particular case, because there are no spaces in YO, it could 
> actually be merely bar:YO )
>
> or give an empty argument
>
> <>  -> and YO
>
>
> <:-)
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/97e96bf3-900c-47c0-8012-adbb66552ad5%40googlegroups.com.


[tw5] Re: Macro with variable number of arguments

2020-04-19 Thread Mat
Macros themselves don't require that all arguments are actually used. If 
all are needed depends only on the logic that you create inside the macro. 

\define foo(bar, baz) $bar$ and $baz$

<> ---> YO and

However be careful because the first argument that you put in the macrocall 
is interpreted as the first parameter. So you must either specify which 
parameter:

<> -> and YO

(in this particular case, because there are no spaces in YO, it could 
actually be merely bar:YO )

or give an empty argument

<>  -> YO and


<:-)

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/262201fb-2244-49f0-ad23-fbdebd3d1afd%40googlegroups.com.