[tw5] Re: Macro

2023-02-05 Thread vinvi...@gmail.com
Thank you  Eric Shulman, it works.


Op zondag 5 februari 2023 om 17:03:31 UTC+1 schreef Eric Shulman:

> Give this a try:
> ```
> \define checkbox-list(values,fieldname)
> <$list filter="[enlist[$values$]]" variable="thisValue" >
> <$checkbox listField="$fieldname$" checked=<>> 
> <>
> 
> \end
> ```
> Notes:
> * If the `values` list has items that contain double quotes or square 
> brackets, those characters will interfere with the parsing of the `$list` 
> filter syntax.  To avoid this problem, instead of writing 
> `filter="[enlist[$values$]]"`, you can write: 
> `filter="[enlist<__values__>]"`.  see 
> https://tiddlywiki.com/#Macro%20Definitions%20in%20WikiText for more info.
> * Note also that, while brackets (square, angled, or curly) within 
> wikitext syntax are doubled, when used in filter syntax, they are SINGLE 
> (i.e., `[enlist<__values__>]`... NOT `[enlist<<__values__>>]`)
>
> enjoy,
> -e
> On Sunday, February 5, 2023 at 7:24:48 AM UTC-8 vinvi...@gmail.com wrote:
>
>> Hi, I'm trying to make a macro.
>>
>> This is my code so far:
>>
>> \define checkbox-list()<$list variable="LIST-FROM-FIELD" 
>> filter="[list[!!LIST-FROM-FIELD]]"><$checkbox listField="WRITE TO 
>> FIELD" checked=<>> <>
>>
>> It now reads the values from a field and displays them with a checkbox in 
>> front of them. 
>> By checking the checkbox, the corresponding value is written to another 
>> field.
>>
>> I would prefer that when calling the macro I could determine which values 
>> should be displayed 
>> without having to put them in a field. 
>>
>> Something like:
>> <>
>>
>> I've been working on $myvar$. and enlist $mylist$.. I can't figure it out.
>>
>> Is there anyone who can help me with this?
>>
>

-- 
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/d03353d3-d0af-4c8c-8877-2fc14488f808n%40googlegroups.com.


[tw5] Re: Macro

2023-02-05 Thread Eric Shulman
Give this a try:
```
\define checkbox-list(values,fieldname)
<$list filter="[enlist[$values$]]" variable="thisValue" >
<$checkbox listField="$fieldname$" checked=<>> 
<>

\end
```
Notes:
* If the `values` list has items that contain double quotes or square 
brackets, those characters will interfere with the parsing of the `$list` 
filter syntax.  To avoid this problem, instead of writing 
`filter="[enlist[$values$]]"`, you can write: 
`filter="[enlist<__values__>]"`.  
see https://tiddlywiki.com/#Macro%20Definitions%20in%20WikiText for more 
info.
* Note also that, while brackets (square, angled, or curly) within wikitext 
syntax are doubled, when used in filter syntax, they are SINGLE (i.e., 
`[enlist<__values__>]`... NOT `[enlist<<__values__>>]`)

enjoy,
-e
On Sunday, February 5, 2023 at 7:24:48 AM UTC-8 vinvi...@gmail.com wrote:

> Hi, I'm trying to make a macro.
>
> This is my code so far:
>
> \define checkbox-list()<$list variable="LIST-FROM-FIELD" 
> filter="[list[!!LIST-FROM-FIELD]]"><$checkbox listField="WRITE TO 
> FIELD" checked=<>> <>
>
> It now reads the values from a field and displays them with a checkbox in 
> front of them. 
> By checking the checkbox, the corresponding value is written to another 
> field.
>
> I would prefer that when calling the macro I could determine which values 
> should be displayed 
> without having to put them in a field. 
>
> Something like:
> <>
>
> I've been working on $myvar$. and enlist $mylist$.. I can't figure it out.
>
> Is there anyone who can help me with this?
>

-- 
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/6c7ac763-016f-4348-80f1-7a6dccc06a93n%40googlegroups.com.


Re: [tw5] Re: Macro editor for KaTeX plugin

2021-08-05 Thread '8d1h' via TiddlyWiki
Hi,

Just for information, I manually updated my local KaTeX to the latest 
version (simply copy the files to the correct location) and everything 
seems to work nicely. 

On Thursday, 5 August 2021 at 18:19:24 UTC+2 Mohammad wrote:

> @Mario,
>
>  Is it possible to update KaTex to 0.13.13! I am not sure if this PR is 
> affected by the update or not! but TW KaTex needs to be updated from 0.12 
> (Jul 2020) to 0.13.13 (Jun 2021)
>
>
>
> Best wishes
> Mohammad
>
>
> On Thu, Aug 5, 2021 at 8:26 PM PMario  wrote:
>
>> Hi folks, 
>>
>> I want to add, that this is _NOT PRODUCTION READY_ at the moment. The PR 
>> at github looks good, but there is still some discussion going on. 
>>
>> So it will be nice to get your feedback here or at github!
>>
>> -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 tiddlywiki+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/ba3a8f4b-3d8d-4bfd-a831-b6edd4e2b5c9n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/95666e5e-92d7-40d1-b4a1-45c8459027den%40googlegroups.com.


Re: [tw5] Re: Macro editor for KaTeX plugin

2021-08-05 Thread Mohammad Rahmani
@Mario,

 Is it possible to update KaTex to 0.13.13! I am not sure if this PR is
affected by the update or not! but TW KaTex needs to be updated from 0.12
(Jul 2020) to 0.13.13 (Jun 2021)



Best wishes
Mohammad


On Thu, Aug 5, 2021 at 8:26 PM PMario  wrote:

> Hi folks,
>
> I want to add, that this is _NOT PRODUCTION READY_ at the moment. The PR
> at github looks good, but there is still some discussion going on.
>
> So it will be nice to get your feedback here or at github!
>
> -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 tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/ba3a8f4b-3d8d-4bfd-a831-b6edd4e2b5c9n%40googlegroups.com
> 
> .
>

-- 
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/CAAV1gMBk0Yj%2BVWzXL%3DW5Hvwbc8morK0hg2z6FqN6owWz1Nf65w%40mail.gmail.com.


[tw5] Re: Macro editor for KaTeX plugin

2021-08-05 Thread PMario
Hi folks, 

I want to add, that this is _NOT PRODUCTION READY_ at the moment. The PR at 
github looks good, but there is still some discussion going on. 

So it will be nice to get your feedback here or at github!

-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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ba3a8f4b-3d8d-4bfd-a831-b6edd4e2b5c9n%40googlegroups.com.


[tw5] Re: macro variable valuation

2021-04-07 Thread Jean-Pierre Rivière
I've checked the view widget. For tge display, it has the same effect as 
the text widget today if used with "text" format.

And if used with "htmlwikified" format, it gives me the html source of what 
I want to display. Add a wikify widget, and that's it ! (No need for my 
"codexe" tiddler).

The code:

!! source code
<$view tiddler=code format=text>
!! output
<$wikify name=sample
text="<$view tiddler=code format=htmlwikified mode=block/>">
<>

I should post a new message to have a clean way to expose the problem and 
the way to resolve it. It might help somebody.

Le mercredi 7 avril 2021 à 01:02:09 UTC+2, Jean-Pierre Rivière a écrit :

> I've been able to have the link with my latest idea. But it adds an other 
> tiddler, tgat I call codexe. this tiddler has a tw5 type and just 
> transclude the code tiddler. Then my user tiddler transclude codexe.
>
> Some code to make things clearer.
>
> * tiddler codexe:
> <$transclude tiddler=code mode=block/>
>
> * tiddler user (modified bits):
> <$wikify text={{codexe}} name=ex>
> <>
> 
> Le mardi 6 avril 2021 à 20:59:14 UTC+2, Jean-Pierre Rivière a écrit :
>
>> If I use
>>
>> DEMO: <$text text=<>/>
>>
>> then I get the body of tho demo macro' with the parameters ($dico$ and 
>> $index$) replaced by the expressions sent as arguments (not their 
>> evaluation). It could be somewhat handy but it was not what was looked for.
>>
>> for the MACRO line, I can't do anything else. I can't use a widget within 
>> a widget.
>>
>> As for wikify, I play with it a lot, but I was unable to get what I 
>> wanted in complex situation. Surely a good hint to indicate that trying a 
>> new approach could be the way to go.
>>
>> Now, I have just devised a way to have a source tiddler to be trancluded 
>> as source and being interpreted: The "code" tiddler has the code AND it is 
>> typed as plain text (this is REQUIRED). I'm doing this:
>>
>> First, the tiddler where is the text to be seen
>> 
>> !! source code
>> 
>> <$text text={{code}}/>
>> 
>> !! output ({{dictionary!!metal}})
>>
>> <$wikify text={{code}} name=ex><>
>>
>> !! here a copycat of the code (hand made, no transclusion)
>>
>> ; value of {{!!index}} to be read in <$link 
>> to={{!!dico}}>{{!!dico}}
>> : field: (<$transclude tiddler={{!!dico}} field={{!!index}}/>)
>> : index: (<$transclude tiddler={{!!dico}} index={{!!index}}/>)
>> -
>> with filelds "dico" set to "dictionary" and "index" to "metal".
>>
>> now the tiddler with the source code (type: simple text)
>> 
>> ; value of {{!!index}} to be read in <$link 
>> to={{!!dico}}>{{!!dico}}
>> : field: (<$transclude tiddler={{!!dico}} field={{!!index}}/>)
>> : index: (<$transclude tiddler={{!!dico}} index={{!!index}}/>)
>> 
>> But this is not perfect. The wiki interpretation is lacking some levels. 
>> For instance, the transcluded code does net interpret the wiki-style 
>> definition and do not produce a link, but the copycat does. but tghe 
>> fetching of the field and of the index works OK for both codes.
>>
>>
>> Le mardi 6 avril 2021 à 18:37:26 UTC+2, Mark S. a écrit :
>>
>>> On Tuesday, April 6, 2021 at 8:57:15 AM UTC-7 jn.pierr...@gmail.com 
>>> wrote:
>>>
 I tried the text widget thus:

 * DEMO: <$text text="""<>"""/>
 * MACRO: <$text text="""<$macrocall $name=demo {{!!dico}} 
 {{!!index}}/>"""/>

>
>>
>>> You wrapped the arguments in strings, so now it interprets your input as 
>>> strings.  The only time that wrapping things in strings gets rendered is if 
>>> you use the wikify widget. So you might play with
>>>
>>> <$wikify text="""<>""" name=rendered >
>>> <$text text=<>/>
>>> 
>>>
>>> Note that wikify has a lot of options for output. So you might not even 
>>> need the text widget if you render as text.
>>>
>>> <$wikify text="""<>""" name=rendered 
>>> output="text">
>>> <>
>>> 
>>>
>>>  
>>>
>>

-- 
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/348604b3-925f-41dc-a37e-a544fa865766n%40googlegroups.com.


[tw5] Re: macro variable valuation

2021-04-06 Thread Jean-Pierre Rivière
I've been able to have the link with my latest idea. But it adds an other 
tiddler, tgat I call codexe. this tiddler has a tw5 type and just 
transclude the code tiddler. Then my user tiddler transclude codexe.

Some code to make things clearer.

* tiddler codexe:
<$transclude tiddler=code mode=block/>

* tiddler user (modified bits):
<$wikify text={{codexe}} name=ex>
<>

Le mardi 6 avril 2021 à 20:59:14 UTC+2, Jean-Pierre Rivière a écrit :

> If I use
>
> DEMO: <$text text=<>/>
>
> then I get the body of tho demo macro' with the parameters ($dico$ and 
> $index$) replaced by the expressions sent as arguments (not their 
> evaluation). It could be somewhat handy but it was not what was looked for.
>
> for the MACRO line, I can't do anything else. I can't use a widget within 
> a widget.
>
> As for wikify, I play with it a lot, but I was unable to get what I wanted 
> in complex situation. Surely a good hint to indicate that trying a new 
> approach could be the way to go.
>
> Now, I have just devised a way to have a source tiddler to be trancluded 
> as source and being interpreted: The "code" tiddler has the code AND it is 
> typed as plain text (this is REQUIRED). I'm doing this:
>
> First, the tiddler where is the text to be seen
> 
> !! source code
> 
> <$text text={{code}}/>
> 
> !! output ({{dictionary!!metal}})
>
> <$wikify text={{code}} name=ex><>
>
> !! here a copycat of the code (hand made, no transclusion)
>
> ; value of {{!!index}} to be read in <$link 
> to={{!!dico}}>{{!!dico}}
> : field: (<$transclude tiddler={{!!dico}} field={{!!index}}/>)
> : index: (<$transclude tiddler={{!!dico}} index={{!!index}}/>)
> -
> with filelds "dico" set to "dictionary" and "index" to "metal".
>
> now the tiddler with the source code (type: simple text)
> 
> ; value of {{!!index}} to be read in <$link 
> to={{!!dico}}>{{!!dico}}
> : field: (<$transclude tiddler={{!!dico}} field={{!!index}}/>)
> : index: (<$transclude tiddler={{!!dico}} index={{!!index}}/>)
> 
> But this is not perfect. The wiki interpretation is lacking some levels. 
> For instance, the transcluded code does net interpret the wiki-style 
> definition and do not produce a link, but the copycat does. but tghe 
> fetching of the field and of the index works OK for both codes.
>
>
> Le mardi 6 avril 2021 à 18:37:26 UTC+2, Mark S. a écrit :
>
>> On Tuesday, April 6, 2021 at 8:57:15 AM UTC-7 jn.pierr...@gmail.com 
>> wrote:
>>
>>> I tried the text widget thus:
>>>
>>> * DEMO: <$text text="""<>"""/>
>>> * MACRO: <$text text="""<$macrocall $name=demo {{!!dico}} 
>>> {{!!index}}/>"""/>
>>>

>
>> You wrapped the arguments in strings, so now it interprets your input as 
>> strings.  The only time that wrapping things in strings gets rendered is if 
>> you use the wikify widget. So you might play with
>>
>> <$wikify text="""<>""" name=rendered >
>> <$text text=<>/>
>> 
>>
>> Note that wikify has a lot of options for output. So you might not even 
>> need the text widget if you render as text.
>>
>> <$wikify text="""<>""" name=rendered 
>> output="text">
>> <>
>> 
>>
>>  
>>
>

-- 
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/b8e71c23-26be-4100-afdc-85ed7cf6fe28n%40googlegroups.com.


[tw5] Re: macro variable valuation

2021-04-06 Thread Jean-Pierre Rivière
If I use

DEMO: <$text text=<>/>

then I get the body of tho demo macro' with the parameters ($dico$ and 
$index$) replaced by the expressions sent as arguments (not their 
evaluation). It could be somewhat handy but it was not what was looked for.

for the MACRO line, I can't do anything else. I can't use a widget within a 
widget.

As for wikify, I play with it a lot, but I was unable to get what I wanted 
in complex situation. Surely a good hint to indicate that trying a new 
approach could be the way to go.

Now, I have just devised a way to have a source tiddler to be trancluded as 
source and being interpreted: The "code" tiddler has the code AND it is 
typed as plain text (this is REQUIRED). I'm doing this:

First, the tiddler where is the text to be seen

!! source code

<$text text={{code}}/>

!! output ({{dictionary!!metal}})

<$wikify text={{code}} name=ex><>

!! here a copycat of the code (hand made, no transclusion)

; value of {{!!index}} to be read in <$link to={{!!dico}}>{{!!dico}}
: field: (<$transclude tiddler={{!!dico}} field={{!!index}}/>)
: index: (<$transclude tiddler={{!!dico}} index={{!!index}}/>)
-
with filelds "dico" set to "dictionary" and "index" to "metal".

now the tiddler with the source code (type: simple text)

; value of {{!!index}} to be read in <$link to={{!!dico}}>{{!!dico}}
: field: (<$transclude tiddler={{!!dico}} field={{!!index}}/>)
: index: (<$transclude tiddler={{!!dico}} index={{!!index}}/>)

But this is not perfect. The wiki interpretation is lacking some levels. 
For instance, the transcluded code does net interpret the wiki-style 
definition and do not produce a link, but the copycat does. but tghe 
fetching of the field and of the index works OK for both codes.


Le mardi 6 avril 2021 à 18:37:26 UTC+2, Mark S. a écrit :

> On Tuesday, April 6, 2021 at 8:57:15 AM UTC-7 jn.pierr...@gmail.com wrote:
>
>> I tried the text widget thus:
>>
>> * DEMO: <$text text="""<>"""/>
>> * MACRO: <$text text="""<$macrocall $name=demo {{!!dico}} 
>> {{!!index}}/>"""/>
>>
>>>

> You wrapped the arguments in strings, so now it interprets your input as 
> strings.  The only time that wrapping things in strings gets rendered is if 
> you use the wikify widget. So you might play with
>
> <$wikify text="""<>""" name=rendered >
> <$text text=<>/>
> 
>
> Note that wikify has a lot of options for output. So you might not even 
> need the text widget if you render as text.
>
> <$wikify text="""<>""" name=rendered 
> output="text">
> <>
> 
>
>  
>

-- 
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/581d5d7b-a6d5-4dff-9137-4ec5c0a96e6dn%40googlegroups.com.


[tw5] Re: macro variable valuation

2021-04-06 Thread 'Mark S.' via TiddlyWiki


On Tuesday, April 6, 2021 at 8:57:15 AM UTC-7 jn.pierr...@gmail.com wrote:

> I tried the text widget thus:
>
> * DEMO: <$text text="""<>"""/>
> * MACRO: <$text text="""<$macrocall $name=demo {{!!dico}} 
> {{!!index}}/>"""/>
>
>>
>>>
You wrapped the arguments in strings, so now it interprets your input as 
strings.  The only time that wrapping things in strings gets rendered is if 
you use the wikify widget. So you might play with

<$wikify text="""<>""" name=rendered >
<$text text=<>/>


Note that wikify has a lot of options for output. So you might not even 
need the text widget if you render as text.

<$wikify text="""<>""" name=rendered 
output="text">
<>


 

-- 
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/fc1ac9ae-8932-490d-9a6c-d7ec7d2df9e6n%40googlegroups.com.


[tw5] Re: macro variable valuation

2021-04-06 Thread Jean-Pierre Rivière
I tried the text widget thus:

* DEMO: <$text text="""<>"""/>
* MACRO: <$text text="""<$macrocall $name=demo {{!!dico}} {{!!index}}/>"""/>

and I got:

   - DEMO: <>
   - MACRO: <$macrocall $name=demo {{!!dico}} {{!!index}}/>

I thought that the macrocall parameter were to interpretated before the 
actual calling of the widget (that's what I understood from Mark S.) and 
was awaiting for an other result for the MACRO line.

   - DEMO: <>
   - MACRO: <$macrocall $name=demo {{!!dico}} {{!!index}}/>



Le mardi 6 avril 2021 à 16:35:12 UTC+2, clutterstack a écrit :

>
> Hi, 
>
> You've troubleshot it pretty well yourself, and you've run into a big 
> difference between WikiText and the kind of programming you might be used 
> to. To quote the docs , "Macros are in 
> fact just parameterised variables". Things don't get evaluated everywhere 
> we put them; generally they get substituted, and only at particular points 
> do they get evaluated. It takes some adjustment to get used to.
>
> The way I look at it, it's not so much that  "{{!!dico}}" and 
> "{{!!index}}" are *not* wikified (evaluated) within the double square 
> bracket. It's more that TW *does* wikify the non-linked ones to render the 
> tiddler. 
>
> The *text* widget is a useful way of checking whether your macro outputs 
> something that TiddlyWiki will wikify into the result you want.
>
> Try
>
> <$text text=<> />
>
> to see what it really looks like when TiddlyWiki goes to wikify it for 
> rendering:
>
> space demo for "{{!!index}}" in "{{!!dico}}" [[{{!!dico}}]] (not 
> [[{{!!dico}}|{{!!index}}]])
>
> As you've noticed,  a text reference like that doesn't work inside the 
> double square brackets of the link shorthand. If you type that out into a 
> tiddler, you'll get the same result as if you run the macro. 
>
> The most obvious way I can think of to get the output you expect is to 
> write out the link widget:
>
> \define spaceDemo2(dico index)
> space demo for "$index$" in "$dico$" <$link to=$dico$/> (not 
> <$link to=$index$>$dico$)
> \end
>
> Best,
> Chris
> On Tuesday, April 6, 2021 at 9:19:36 AM UTC-4 jn.pierr...@gmail.com wrote:
>
>> I wanted to check if having space within a dictionary name or an index 
>> name was a go or a no-go for tw. So I wrote a macro to check it up (BTW, 
>> the answer is: no, it doesn't matter).
>>
>> OK, now for what I want to say here, the macro will only print its 
>> arguments as is and as a wiki link.
>>
>>
>> \define spaceDemo(dico index)
>> !!! space demo for "$index$" in "$dico$" [[$dico$]] (not 
>> [[$dico$|$index$]])
>> \end
>>
>> and now the invocation was
>>
>> <>
>> <>
>> <>
>> <>
>>
>> and I got what I thought I would get, like
>>
>> space demo for "ma citation" in "mon autre dico" mon autre dico (not mon 
>> autre dico)
>>
>> witg tge first link pointing to "mon autre dico" and the second to "ma 
>> citation".
>>
>> But then I added two fields within thi tidder calling the macro:
>> * a "dico" field containing "mon autre dico"
>> * an "index" field containing "ma citation"
>>
>> and I called the macro thus:
>>
>> <>
>>
>> and then, surprise!, I got:
>>
>> space demo for "ma citation" in "mon autre dico" {{!!dico}} (not 
>> {{!!dico}})
>>
>> with the first link to the litteral "{{!dico}}" and the second to 
>> "{{!!index}}".
>>
>> I would have thought the argument transmitted would have been interpreted 
>> before calling the macro. And why then this differences of treatment? What 
>> is the mechanism responsible of this?
>>
>> Practical interest, BTW: with" [[$arg$]]" you can see 
>> how really was written the argument "arg" when the macro was called.
>>
>> Regards,
>>
>>
>>
>>
>>
>>
>>

-- 
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/96b76ce0-4e59-4d29-89f3-d6a89997ca71n%40googlegroups.com.


[tw5] Re: macro variable valuation

2021-04-06 Thread Jean-Pierre Rivière
Thank you Mark, this is most clear and straightforward.

So I've introduced an auxmacro to be sure what I get is what I want:

\define auxdemo(dico, index) <$macrocall $name=spacedemo dico=$dico$ 
index=$index$/>

ÇThat way, it will be easier to write my macro. No more ugly surprise. And 
yes it is usefull' because sometimes you cannot use the macrocall widget if 
one of your parameter needs to be a macrocall widget too! In fact, this and 
the impossibility to use a macro as parameter of a macro are annoying in 
the long run, a grammatical distraction from your programming goal to 
achieve one's useful purpose.


Le mardi 6 avril 2021 à 16:39:02 UTC+2, Mark S. a écrit :

> Macros with << >> syntax do simple text substitution. They look like 
> "functions", but they are really just text substituters (new word).
>
> Sometimes AFTER the substitution things will get rendered. So in your 
> expression
>
> !!! space demo for "$index$" in "$dico$" [[$dico$]] (not 
> [[$dico$|$index$]])
>
> only the first $dico$ gets rendered. That happens AFTER the substitution. 
> The second and 3rd $dico$ are inserted literally, because they are inside 
> more wikitext (the links).
>
> Widgets, on the other hand, convert parameters before handling them. So 
> you might get the result you expect with:
>
> <$macrocall $name=spaceDemo dico={{!!dico}} index={{!!index}} />
>
> On Tuesday, April 6, 2021 at 6:19:36 AM UTC-7 jn.pierr...@gmail.com wrote:
>
>> I wanted to check if having space within a dictionary name or an index 
>> name was a go or a no-go for tw. So I wrote a macro to check it up (BTW, 
>> the answer is: no, it doesn't matter).
>>
>> OK, now for what I want to say here, the macro will only print its 
>> arguments as is and as a wiki link.
>>
>>
>> \define spaceDemo(dico index)
>> !!! space demo for "$index$" in "$dico$" [[$dico$]] (not 
>> [[$dico$|$index$]])
>> \end
>>
>> and now the invocation was
>>
>> <>
>> <>
>> <>
>> <>
>>
>> and I got what I thought I would get, like
>>
>> space demo for "ma citation" in "mon autre dico" mon autre dico (not mon 
>> autre dico)
>>
>> witg tge first link pointing to "mon autre dico" and the second to "ma 
>> citation".
>>
>> But then I added two fields within thi tidder calling the macro:
>> * a "dico" field containing "mon autre dico"
>> * an "index" field containing "ma citation"
>>
>> and I called the macro thus:
>>
>> <>
>>
>> and then, surprise!, I got:
>>
>> space demo for "ma citation" in "mon autre dico" {{!!dico}} (not 
>> {{!!dico}})
>>
>> with the first link to the litteral "{{!dico}}" and the second to 
>> "{{!!index}}".
>>
>> I would have thought the argument transmitted would have been interpreted 
>> before calling the macro. And why then this differences of treatment? What 
>> is the mechanism responsible of this?
>>
>> Practical interest, BTW: with" [[$arg$]]" you can see 
>> how really was written the argument "arg" when the macro was called.
>>
>> Regards,
>>
>>
>>
>>
>>
>>
>>

-- 
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/e7107979-4a2e-4192-be4a-8add241acdb0n%40googlegroups.com.


[tw5] Re: macro variable valuation

2021-04-06 Thread 'Mark S.' via TiddlyWiki
Macros with << >> syntax do simple text substitution. They look like 
"functions", but they are really just text substituters (new word).

Sometimes AFTER the substitution things will get rendered. So in your 
expression

!!! space demo for "$index$" in "$dico$" [[$dico$]] (not [[$dico$|$index$]])

only the first $dico$ gets rendered. That happens AFTER the substitution. 
The second and 3rd $dico$ are inserted literally, because they are inside 
more wikitext (the links).

Widgets, on the other hand, convert parameters before handling them. So you 
might get the result you expect with:

<$macrocall $name=spaceDemo dico={{!!dico}} index={{!!index}} />

On Tuesday, April 6, 2021 at 6:19:36 AM UTC-7 jn.pierr...@gmail.com wrote:

> I wanted to check if having space within a dictionary name or an index 
> name was a go or a no-go for tw. So I wrote a macro to check it up (BTW, 
> the answer is: no, it doesn't matter).
>
> OK, now for what I want to say here, the macro will only print its 
> arguments as is and as a wiki link.
>
>
> \define spaceDemo(dico index)
> !!! space demo for "$index$" in "$dico$" [[$dico$]] (not 
> [[$dico$|$index$]])
> \end
>
> and now the invocation was
>
> <>
> <>
> <>
> <>
>
> and I got what I thought I would get, like
>
> space demo for "ma citation" in "mon autre dico" mon autre dico (not mon 
> autre dico)
>
> witg tge first link pointing to "mon autre dico" and the second to "ma 
> citation".
>
> But then I added two fields within thi tidder calling the macro:
> * a "dico" field containing "mon autre dico"
> * an "index" field containing "ma citation"
>
> and I called the macro thus:
>
> <>
>
> and then, surprise!, I got:
>
> space demo for "ma citation" in "mon autre dico" {{!!dico}} (not 
> {{!!dico}})
>
> with the first link to the litteral "{{!dico}}" and the second to 
> "{{!!index}}".
>
> I would have thought the argument transmitted would have been interpreted 
> before calling the macro. And why then this differences of treatment? What 
> is the mechanism responsible of this?
>
> Practical interest, BTW: with" [[$arg$]]" you can see 
> how really was written the argument "arg" when the macro was called.
>
> Regards,
>
>
>
>
>
>
>

-- 
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/1d825cb2-18b7-46e7-8069-3a3186604d6an%40googlegroups.com.


[tw5] Re: macro variable valuation

2021-04-06 Thread clutterstack

Hi, 

You've troubleshot it pretty well yourself, and you've run into a big 
difference between WikiText and the kind of programming you might be used 
to. To quote the docs , "Macros are in fact 
just parameterised variables". Things don't get evaluated everywhere we put 
them; generally they get substituted, and only at particular points do they 
get evaluated. It takes some adjustment to get used to.

The way I look at it, it's not so much that  "{{!!dico}}" and "{{!!index}}" 
are *not* wikified (evaluated) within the double square bracket. It's more 
that TW *does* wikify the non-linked ones to render the tiddler. 

The *text* widget is a useful way of checking whether your macro outputs 
something that TiddlyWiki will wikify into the result you want.

Try

<$text text=<> />

to see what it really looks like when TiddlyWiki goes to wikify it for 
rendering:

space demo for "{{!!index}}" in "{{!!dico}}" [[{{!!dico}}]] (not 
[[{{!!dico}}|{{!!index}}]])

As you've noticed,  a text reference like that doesn't work inside the 
double square brackets of the link shorthand. If you type that out into a 
tiddler, you'll get the same result as if you run the macro. 

The most obvious way I can think of to get the output you expect is to 
write out the link widget:

\define spaceDemo2(dico index)
space demo for "$index$" in "$dico$" <$link to=$dico$/> (not 
<$link to=$index$>$dico$)
\end

Best,
Chris
On Tuesday, April 6, 2021 at 9:19:36 AM UTC-4 jn.pierr...@gmail.com wrote:

> I wanted to check if having space within a dictionary name or an index 
> name was a go or a no-go for tw. So I wrote a macro to check it up (BTW, 
> the answer is: no, it doesn't matter).
>
> OK, now for what I want to say here, the macro will only print its 
> arguments as is and as a wiki link.
>
>
> \define spaceDemo(dico index)
> !!! space demo for "$index$" in "$dico$" [[$dico$]] (not 
> [[$dico$|$index$]])
> \end
>
> and now the invocation was
>
> <>
> <>
> <>
> <>
>
> and I got what I thought I would get, like
>
> space demo for "ma citation" in "mon autre dico" mon autre dico (not mon 
> autre dico)
>
> witg tge first link pointing to "mon autre dico" and the second to "ma 
> citation".
>
> But then I added two fields within thi tidder calling the macro:
> * a "dico" field containing "mon autre dico"
> * an "index" field containing "ma citation"
>
> and I called the macro thus:
>
> <>
>
> and then, surprise!, I got:
>
> space demo for "ma citation" in "mon autre dico" {{!!dico}} (not 
> {{!!dico}})
>
> with the first link to the litteral "{{!dico}}" and the second to 
> "{{!!index}}".
>
> I would have thought the argument transmitted would have been interpreted 
> before calling the macro. And why then this differences of treatment? What 
> is the mechanism responsible of this?
>
> Practical interest, BTW: with" [[$arg$]]" you can see 
> how really was written the argument "arg" when the macro was called.
>
> Regards,
>
>
>
>
>
>
>

-- 
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/ef0e765c-e9c5-4565-b35b-03a45ccf8cc8n%40googlegroups.com.


Re: [tw5] Re: Macro call question

2021-03-26 Thread Jeremy Ruston
Hi Damon

By default the wikify widget parses the text using "block" mode, where 
paragraphs are generated, and block formatting like headings and list are 
recognised. You can force "inline" mode with the "mode" attribute:

https://tiddlywiki.com/#WikifyWidget

Best wishes

Jeremy

--
Jeremy Ruston
jer...@jermolene.com
https://jermolene.com

> On 25 Mar 2021, at 22:48, History Buff  wrote:
> 
> Alright, that seems to do the trick for the most part.
> 
> I do have a question though. Using the wikify widget with the output set to 
> html puts a leading  and trailing  around the text I enter. This 
> normally wouldn't be a big deal, but since this is ultimately ending up in a 
> table cell, it causes the row to be higher than it would otherwise which I 
> don't care for. Is it possible for these paragraph tags to not be generated? 
> If not, then is there another way to do what I want to do? 
> 
> Here's the wikify code and the macro for adding the span tags I ended up 
> with: 
> 
> \define newtext(text)
>   Hover...
> 
>   $text$
> 
>   
> \end
> 
> <$wikify name=text text="""<$macrocall $name=newtext text=<> />""" 
> output=html >
> 
> Any help would be greatly appreciated.
> 
> Damon
> 
>> On Thursday, March 25, 2021 at 10:11:52 AM UTC-7 History Buff wrote:
>> After a bit of research, I discovered the output parameter of the wikify 
>> widget. I hadn't noticed that when I had tried wikify before. If I set the 
>> output to html, then I seem to get exactly what I want (at least in the 
>> experiment that I did). I will next try it in my mileage macro to make sure.
>> 
>> I'm still open to any comments or suggestions on improvements of my macro.
>> 
>>> On Thursday, March 25, 2021 at 9:41:42 AM UTC-7 History Buff wrote:
>>> One more thing I should point out is that the above only works if I type in 
>>> the text in the notes area first and then select from the drop downs. If I 
>>> do a dropdown first, all of the default text disappears so this really 
>>> isn't an optimal solution.
>>> 
 On Wednesday, March 24, 2021 at 2:34:33 PM UTC-7 History Buff wrote:
 Greetings smart people,
 
 I'm trying to generate a form where one of the input areas ends up in a 
 tooltip (the notes and sources area). I've got a working model, but I 
 don't like the way it's implemented. It seems like there should be a more 
 elegant way to do it, but I haven't found a working solution after a few 
 hours of fiddling. The screenshot shows the form with my ugly way where I 
 use the default text parameter to include the spans for the tooltip and 
 the actual input is between them. What I want is to have a macro that adds 
 these spans and I don't have to have them visible. The code I'm currently 
 using to generate this is below the screenshot. I've defined a macro that 
 I think will work at the top, but I haven't been able figure out a way to 
 invoke it and have it work. Any help would be greatly appreciated.
 
 
 
 \define newtitle(name,date)
   $name$ ($date$)
 \end
 \define newtext(text)
   Hover...
   
   $text$
   
   
 \end
 \define NewMileageEntry()
   <$vars
 temp="$:/temp/NewEntry">
 Company Performing Activity: <$select tiddler=<> field=company 
 tooltip="Select Company">
   <$list filter='[!is[system]tag[Railroads]]'>
 <$view field='title'/>
   
 
   
 Mileage Received From: <$select tiddler=<> field=from 
 tooltip="Select railroad that mileage was received from">
   <$list filter='[!is[system]tag[Railroads]]'>
 <$view field='title'/>
   
 
   
 Mileage Transferred To: <$select tiddler=<> field=to 
 tooltip="Select railroad receiving the mileage">
   <$list filter='[!is[system]tag[Railroads]]'>
 <$view field='title'/>
   
 
   
 Date: <$edit-text
   tiddler=<>
   field=date
   class=fieldinput
   tag=input
   size=12
   placeholder="-mm-dd"
 />
   
 Mileage: <$edit-text
   tiddler=<>
   field=mileage
   class=fieldinput
   tag=input
   size=8
 /> 
Not in Kansas? <$checkbox tiddler=<> field="outofstate" 
 checked="yes" unchecked="" default="">

 (C)onstructed, (A)bandoned, (S)old, (L)eased, (R)eclassified: 
 <$edit-text
   tiddler=<>
   field=mileagetype
   class=fieldinput
   tag=input
   size=4
 />
   
 Origin: <$edit-text
   tiddler=<>
   field=origin
   class=fieldinput
   tag=input
   size=72
 />
   
 Destination: <$edit-text
   tiddler=<>
   field=destination
   class=fieldinput
   tag=input
   size=72
 

[tw5] Re: Macro call question

2021-03-25 Thread History Buff
Alright, that seems to do the trick for the most part.

I do have a question though. Using the wikify widget with the output set to 
html puts a leading  and trailing  around the text I enter. This 
normally wouldn't be a big deal, but since this is ultimately ending up in 
a table cell, it causes the row to be higher than it would otherwise which 
I don't care for. Is it possible for these paragraph tags to not be 
generated? If not, then is there another way to do what I want to do? 

Here's the wikify code and the macro for adding the span tags I ended up 
with: 

\define newtext(text)
  Hover...

  $text$

  
\end

<$wikify name=text text="""<$macrocall $name=newtext text=<> />""" 
output=html >

Any help would be greatly appreciated.

Damon

On Thursday, March 25, 2021 at 10:11:52 AM UTC-7 History Buff wrote:

> After a bit of research, I discovered the output parameter of the wikify 
> widget. I hadn't noticed that when I had tried wikify before. If I set the 
> output to html, then I seem to get exactly what I want (at least in the 
> experiment that I did). I will next try it in my mileage macro to make sure.
>
> I'm still open to any comments or suggestions on improvements of my macro.
>
> On Thursday, March 25, 2021 at 9:41:42 AM UTC-7 History Buff wrote:
>
>> One more thing I should point out is that the above only works if I type 
>> in the text in the notes area first and then select from the drop downs. If 
>> I do a dropdown first, all of the default text disappears so this really 
>> isn't an optimal solution.
>>
>> On Wednesday, March 24, 2021 at 2:34:33 PM UTC-7 History Buff wrote:
>>
>>> Greetings smart people,
>>>
>>> I'm trying to generate a form where one of the input areas ends up in a 
>>> tooltip (the notes and sources area). I've got a working model, but I don't 
>>> like the way it's implemented. It seems like there should be a more elegant 
>>> way to do it, but I haven't found a working solution after a few hours of 
>>> fiddling. The screenshot shows the form with my ugly way where I use the 
>>> default text parameter to include the spans for the tooltip and the actual 
>>> input is between them. What I want is to have a macro that adds these spans 
>>> and I don't have to have them visible. The code I'm currently using to 
>>> generate this is below the screenshot. I've defined a macro that I think 
>>> will work at the top, but I haven't been able figure out a way to invoke it 
>>> and have it work. Any help would be greatly appreciated.
>>>
>>> [image: Screenshot 2021-03-24 142940.png]
>>>
>>> \define newtitle(name,date)
>>>   $name$ ($date$)
>>> \end
>>> \define newtext(text)
>>>   Hover...
>>>   
>>>   $text$
>>>   
>>>   
>>> \end
>>> \define NewMileageEntry()
>>>   <$vars
>>> temp="$:/temp/NewEntry">
>>> Company Performing Activity: <$select tiddler=<> field=company 
>>> tooltip="Select Company">
>>>   <$list filter='[!is[system]tag[Railroads]]'>
>>> <$view field='title'/>
>>>   
>>> 
>>>   
>>> Mileage Received From: <$select tiddler=<> field=from 
>>> tooltip="Select railroad that mileage was received from">
>>>   <$list filter='[!is[system]tag[Railroads]]'>
>>> <$view field='title'/>
>>>   
>>> 
>>>   
>>> Mileage Transferred To: <$select tiddler=<> field=to 
>>> tooltip="Select railroad receiving the mileage">
>>>   <$list filter='[!is[system]tag[Railroads]]'>
>>> <$view field='title'/>
>>>   
>>> 
>>>   
>>> Date: <$edit-text
>>>   tiddler=<>
>>>   field=date
>>>   class=fieldinput
>>>   tag=input
>>>   size=12
>>>   placeholder="-mm-dd"
>>> />
>>>   
>>> Mileage: <$edit-text
>>>   tiddler=<>
>>>   field=mileage
>>>   class=fieldinput
>>>   tag=input
>>>   size=8
>>> /> 
>>>Not in Kansas? <$checkbox tiddler=<> field="outofstate" 
>>> checked="yes" unchecked="" default="">
>>>
>>> (C)onstructed, (A)bandoned, (S)old, (L)eased, (R)eclassified: 
>>> <$edit-text
>>>   tiddler=<>
>>>   field=mileagetype
>>>   class=fieldinput
>>>   tag=input
>>>   size=4
>>> />
>>>   
>>> Origin: <$edit-text
>>>   tiddler=<>
>>>   field=origin
>>>   class=fieldinput
>>>   tag=input
>>>   size=72
>>> />
>>>   
>>> Destination: <$edit-text
>>>   tiddler=<>
>>>   field=destination
>>>   class=fieldinput
>>>   tag=input
>>>   size=72
>>> />
>>>   
>>>   Notes, Sources, etc.:
>>> <$edit-text
>>>   tiddler=<>
>>>   field=notes
>>>   class=fieldarea
>>>   tag=textarea
>>>   default="""Hover...
>>>   
>>> Enter your text here.
>>>   
>>> """
>>> />
>>>   
>>> <$button tooltip="save input" > {{$:/images/train-track}} Add New 
>>> Mileage
>>>   <$vars
>>> date={{{ [titleget[date]] }}}
>>> mileage={{{ [titleget[mileage]] }}}
>>> mileagetype={{{ [titleget[mileagetype]] }}}
>>> outofstate={{{ [tit

[tw5] Re: Macro call question

2021-03-25 Thread History Buff
After a bit of research, I discovered the output parameter of the wikify 
widget. I hadn't noticed that when I had tried wikify before. If I set the 
output to html, then I seem to get exactly what I want (at least in the 
experiment that I did). I will next try it in my mileage macro to make sure.

I'm still open to any comments or suggestions on improvements of my macro.

On Thursday, March 25, 2021 at 9:41:42 AM UTC-7 History Buff wrote:

> One more thing I should point out is that the above only works if I type 
> in the text in the notes area first and then select from the drop downs. If 
> I do a dropdown first, all of the default text disappears so this really 
> isn't an optimal solution.
>
> On Wednesday, March 24, 2021 at 2:34:33 PM UTC-7 History Buff wrote:
>
>> Greetings smart people,
>>
>> I'm trying to generate a form where one of the input areas ends up in a 
>> tooltip (the notes and sources area). I've got a working model, but I don't 
>> like the way it's implemented. It seems like there should be a more elegant 
>> way to do it, but I haven't found a working solution after a few hours of 
>> fiddling. The screenshot shows the form with my ugly way where I use the 
>> default text parameter to include the spans for the tooltip and the actual 
>> input is between them. What I want is to have a macro that adds these spans 
>> and I don't have to have them visible. The code I'm currently using to 
>> generate this is below the screenshot. I've defined a macro that I think 
>> will work at the top, but I haven't been able figure out a way to invoke it 
>> and have it work. Any help would be greatly appreciated.
>>
>> [image: Screenshot 2021-03-24 142940.png]
>>
>> \define newtitle(name,date)
>>   $name$ ($date$)
>> \end
>> \define newtext(text)
>>   Hover...
>>   
>>   $text$
>>   
>>   
>> \end
>> \define NewMileageEntry()
>>   <$vars
>> temp="$:/temp/NewEntry">
>> Company Performing Activity: <$select tiddler=<> field=company 
>> tooltip="Select Company">
>>   <$list filter='[!is[system]tag[Railroads]]'>
>> <$view field='title'/>
>>   
>> 
>>   
>> Mileage Received From: <$select tiddler=<> field=from 
>> tooltip="Select railroad that mileage was received from">
>>   <$list filter='[!is[system]tag[Railroads]]'>
>> <$view field='title'/>
>>   
>> 
>>   
>> Mileage Transferred To: <$select tiddler=<> field=to 
>> tooltip="Select railroad receiving the mileage">
>>   <$list filter='[!is[system]tag[Railroads]]'>
>> <$view field='title'/>
>>   
>> 
>>   
>> Date: <$edit-text
>>   tiddler=<>
>>   field=date
>>   class=fieldinput
>>   tag=input
>>   size=12
>>   placeholder="-mm-dd"
>> />
>>   
>> Mileage: <$edit-text
>>   tiddler=<>
>>   field=mileage
>>   class=fieldinput
>>   tag=input
>>   size=8
>> /> 
>>Not in Kansas? <$checkbox tiddler=<> field="outofstate" 
>> checked="yes" unchecked="" default="">
>>
>> (C)onstructed, (A)bandoned, (S)old, (L)eased, (R)eclassified: 
>> <$edit-text
>>   tiddler=<>
>>   field=mileagetype
>>   class=fieldinput
>>   tag=input
>>   size=4
>> />
>>   
>> Origin: <$edit-text
>>   tiddler=<>
>>   field=origin
>>   class=fieldinput
>>   tag=input
>>   size=72
>> />
>>   
>> Destination: <$edit-text
>>   tiddler=<>
>>   field=destination
>>   class=fieldinput
>>   tag=input
>>   size=72
>> />
>>   
>>   Notes, Sources, etc.:
>> <$edit-text
>>   tiddler=<>
>>   field=notes
>>   class=fieldarea
>>   tag=textarea
>>   default="""Hover...
>>   
>> Enter your text here.
>>   
>> """
>> />
>>   
>> <$button tooltip="save input" > {{$:/images/train-track}} Add New 
>> Mileage
>>   <$vars
>> date={{{ [titleget[date]] }}}
>> mileage={{{ [titleget[mileage]] }}}
>> mileagetype={{{ [titleget[mileagetype]] }}}
>> outofstate={{{ [titleget[outofstate]] }}}
>> origin={{{ [titleget[origin]] }}}
>> destination={{{ [titleget[destination]] }}}
>> notes={{{ [titleget[notes]] }}}
>> company={{{ [titleget[company]] }}}
>> source={{{ [titleget[source]] }}}
>> from={{{ [titleget[from]] }}}
>> to={{{ [titleget[to]] }}} >
>>   <$wikify name=tidname text="""<$macrocall $name=newtitle 
>> name=<> date=<> />""">
>> <$set name="namelink" filter="[title]">
>>   <$set name="fromlink" filter="[title]">
>>   <$set name="tolink" filter="[title]">
>> <$action-createtiddler
>>   $basetitle=<>
>>   date=<>
>>   mileage=<>
>>   mileagetype=<>
>>   origin=<>
>>   outofstate=<>
>>   destination=<>
>>   tags=<>
>>   company=<>
>>   from=<>
>>   to=<>
>>   text=<> />
>>   
>>

[tw5] Re: Macro call question

2021-03-25 Thread History Buff
One more thing I should point out is that the above only works if I type in 
the text in the notes area first and then select from the drop downs. If I 
do a dropdown first, all of the default text disappears so this really 
isn't an optimal solution.

On Wednesday, March 24, 2021 at 2:34:33 PM UTC-7 History Buff wrote:

> Greetings smart people,
>
> I'm trying to generate a form where one of the input areas ends up in a 
> tooltip (the notes and sources area). I've got a working model, but I don't 
> like the way it's implemented. It seems like there should be a more elegant 
> way to do it, but I haven't found a working solution after a few hours of 
> fiddling. The screenshot shows the form with my ugly way where I use the 
> default text parameter to include the spans for the tooltip and the actual 
> input is between them. What I want is to have a macro that adds these spans 
> and I don't have to have them visible. The code I'm currently using to 
> generate this is below the screenshot. I've defined a macro that I think 
> will work at the top, but I haven't been able figure out a way to invoke it 
> and have it work. Any help would be greatly appreciated.
>
> [image: Screenshot 2021-03-24 142940.png]
>
> \define newtitle(name,date)
>   $name$ ($date$)
> \end
> \define newtext(text)
>   Hover...
>   
>   $text$
>   
>   
> \end
> \define NewMileageEntry()
>   <$vars
> temp="$:/temp/NewEntry">
> Company Performing Activity: <$select tiddler=<> field=company 
> tooltip="Select Company">
>   <$list filter='[!is[system]tag[Railroads]]'>
> <$view field='title'/>
>   
> 
>   
> Mileage Received From: <$select tiddler=<> field=from 
> tooltip="Select railroad that mileage was received from">
>   <$list filter='[!is[system]tag[Railroads]]'>
> <$view field='title'/>
>   
> 
>   
> Mileage Transferred To: <$select tiddler=<> field=to 
> tooltip="Select railroad receiving the mileage">
>   <$list filter='[!is[system]tag[Railroads]]'>
> <$view field='title'/>
>   
> 
>   
> Date: <$edit-text
>   tiddler=<>
>   field=date
>   class=fieldinput
>   tag=input
>   size=12
>   placeholder="-mm-dd"
> />
>   
> Mileage: <$edit-text
>   tiddler=<>
>   field=mileage
>   class=fieldinput
>   tag=input
>   size=8
> /> 
>Not in Kansas? <$checkbox tiddler=<> field="outofstate" 
> checked="yes" unchecked="" default="">
>
> (C)onstructed, (A)bandoned, (S)old, (L)eased, (R)eclassified: 
> <$edit-text
>   tiddler=<>
>   field=mileagetype
>   class=fieldinput
>   tag=input
>   size=4
> />
>   
> Origin: <$edit-text
>   tiddler=<>
>   field=origin
>   class=fieldinput
>   tag=input
>   size=72
> />
>   
> Destination: <$edit-text
>   tiddler=<>
>   field=destination
>   class=fieldinput
>   tag=input
>   size=72
> />
>   
>   Notes, Sources, etc.:
> <$edit-text
>   tiddler=<>
>   field=notes
>   class=fieldarea
>   tag=textarea
>   default="""Hover...
>   
> Enter your text here.
>   
> """
> />
>   
> <$button tooltip="save input" > {{$:/images/train-track}} Add New 
> Mileage
>   <$vars
> date={{{ [titleget[date]] }}}
> mileage={{{ [titleget[mileage]] }}}
> mileagetype={{{ [titleget[mileagetype]] }}}
> outofstate={{{ [titleget[outofstate]] }}}
> origin={{{ [titleget[origin]] }}}
> destination={{{ [titleget[destination]] }}}
> notes={{{ [titleget[notes]] }}}
> company={{{ [titleget[company]] }}}
> source={{{ [titleget[source]] }}}
> from={{{ [titleget[from]] }}}
> to={{{ [titleget[to]] }}} >
>   <$wikify name=tidname text="""<$macrocall $name=newtitle 
> name=<> date=<> />""">
> <$set name="namelink" filter="[title]">
>   <$set name="fromlink" filter="[title]">
>   <$set name="tolink" filter="[title]">
> <$action-createtiddler
>   $basetitle=<>
>   date=<>
>   mileage=<>
>   mileagetype=<>
>   origin=<>
>   outofstate=<>
>   destination=<>
>   tags=<>
>   company=<>
>   from=<>
>   to=<>
>   text=<> />
>   
>   
> 
>   
>   
>   <$action-deletetiddler $filter="[]" />
> 
> <$button tooltip="cancel input"> {{$:/core/images/cancel-button}} 
> Clear Entries
>   <$action-deletetiddler $filter="[]" />
> 
>   
> \end
>

-- 
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/7cdd3038-7985-4bee-bccf-42c82baedea

[tw5] Re: Macro: How convert wikified macro output as a "List"

2021-03-03 Thread Mohamed Amin
Thanks a lot Mat for your notes/pointers, I really appreciate it.

Regarding the "4 brackets"; actually I got it from this conversation 
 , and 
it works OK with me, and if I used only 2 brackets, the "enlist" doesn't 
split the input variable.

Thanks again for your time here
On Wednesday, March 3, 2021 at 11:32:34 AM UTC+2 Mat wrote:

> Instead of 
>
> <$list variable="myList" filter="[enlist]">
> Auther of : <>  is {{{[get[auther]]}}}
> 
>
> you don't need a variable
>
> <$list filter="[enlist]">
> Auther of :<$link/> or <$view field=title/>  is {{!!auther}}
> 
>
> <:-)
>
> On Wednesday, March 3, 2021 at 10:27:31 AM UTC+1 Mat wrote:
>
>> OK this is just to give some pointers. I did not test your (nor my) code 
>> so maybe you had good reasons for exactly how you did it and my suggestions 
>> don't work.
>>
>> \define prepEnlisting(nlst) 
>>> $nlst$
>>> \end
>>>
>>
>> Not sure why you're using all those brackets. You can probably write it 
>> in a single row like:
>>
>> \define prepEnlisting() [[$(nlst)$]]
>>
>> \define myBooks(category lang)
>>> <$list filter="[all[tiddlers]tag[$category$]tag[$lang$]]" 
>>> variable="macO">
>>> <$macrocall $name="prepEnlisting"  nlst=<> />
>>> 
>>> \end
>>>
>>
>> Put triple quotes around the filters when there's a chance some item has 
>> a quote character in its name.
>>
>> \define myBooks(category lang)
>> <$list filter="""[all[tiddlers]tag[$category$]tag[$lang$]]""" 
>> variable="macO">
>> <>
>> 
>> \end
>>
>>  
>>
>>> <$wikify name="wkfd" text="<>" >
>>> <$list variable="myList" filter="[enlist]">
>>> Auther of : <>  is {{{[get[auther]]}}}
>>> 
>>> 
>>>
>>
>> So the wikifywidget is supposedly very resource demanding so it is to be 
>> avoided when possible. I'd guess it works with a setwidget:
>>
>> <:-)
>>
>>

-- 
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/410f775c-7142-4d39-aa80-4c64bba0c6a3n%40googlegroups.com.


[tw5] Re: Macro: How convert wikified macro output as a "List"

2021-03-03 Thread Mat
Instead of 

<$list variable="myList" filter="[enlist]">
Auther of : <>  is {{{[get[auther]]}}}


you don't need a variable

<$list filter="[enlist]">
Auther of :<$link/> or <$view field=title/>  is {{!!auther}}


<:-)

On Wednesday, March 3, 2021 at 10:27:31 AM UTC+1 Mat wrote:

> OK this is just to give some pointers. I did not test your (nor my) code 
> so maybe you had good reasons for exactly how you did it and my suggestions 
> don't work.
>
> \define prepEnlisting(nlst) 
>> $nlst$
>> \end
>>
>
> Not sure why you're using all those brackets. You can probably write it in 
> a single row like:
>
> \define prepEnlisting() [[$(nlst)$]]
>
> \define myBooks(category lang)
>> <$list filter="[all[tiddlers]tag[$category$]tag[$lang$]]" variable="macO">
>> <$macrocall $name="prepEnlisting"  nlst=<> />
>> 
>> \end
>>
>
> Put triple quotes around the filters when there's a chance some item has a 
> quote character in its name.
>
> \define myBooks(category lang)
> <$list filter="""[all[tiddlers]tag[$category$]tag[$lang$]]""" 
> variable="macO">
> <>
> 
> \end
>
>  
>
>> <$wikify name="wkfd" text="<>" >
>> <$list variable="myList" filter="[enlist]">
>> Auther of : <>  is {{{[get[auther]]}}}
>> 
>> 
>>
>
> So the wikifywidget is supposedly very resource demanding so it is to be 
> avoided when possible. I'd guess it works with a setwidget:
>
> <:-)
>
>

-- 
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/6d56014b-911e-4736-b279-6f9c04b3b2dfn%40googlegroups.com.


[tw5] Re: Macro: How convert wikified macro output as a "List"

2021-03-03 Thread Mat
OK this is just to give some pointers. I did not test your (nor my) code so 
maybe you had good reasons for exactly how you did it and my suggestions 
don't work.

\define prepEnlisting(nlst) 
> $nlst$
> \end
>

Not sure why you're using all those brackets. You can probably write it in 
a single row like:

\define prepEnlisting() [[$(nlst)$]]

\define myBooks(category lang)
> <$list filter="[all[tiddlers]tag[$category$]tag[$lang$]]" variable="macO">
> <$macrocall $name="prepEnlisting"  nlst=<> />
> 
> \end
>

Put triple quotes around the filters when there's a chance some item has a 
quote character in its name.

\define myBooks(category lang)
<$list filter="""[all[tiddlers]tag[$category$]tag[$lang$]]""" 
variable="macO">
<>

\end

 

> <$wikify name="wkfd" text="<>" >
> <$list variable="myList" filter="[enlist]">
> Auther of : <>  is {{{[get[auther]]}}}
> 
> 
>

So the wikifywidget is supposedly very resource demanding so it is to be 
avoided when possible. I'd guess it works with a setwidget:

<:-)

-- 
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/110cc581-049b-4c1c-b1be-83d0990c4d00n%40googlegroups.com.


[tw5] Re: Macro: How convert wikified macro output as a "List"

2021-03-02 Thread Mohamed Amin
Actually I used the following to keep Macro parameter "locally"

\define prepEnlisting(nlst) 
$nlst$
\end
\define myBooks(category lang)
<$list filter="[all[tiddlers]tag[$category$]tag[$lang$]]" variable="macO">
<$macrocall $name="prepEnlisting"  nlst=<> />

\end

<$wikify name="wkfd" text="<>" >
<$list variable="myList" filter="[enlist]">
Auther of : <>  is {{{[get[auther]]}}}



Again, is there any other implementations?
On Wednesday, March 3, 2021 at 3:03:17 AM UTC+2 Mohamed Amin wrote:

> Ok, I figured it out (Thanks BTC 
> )
>
> \define prepEnlisting(nlst) 
> $(macO)$
> \end
> \define myBooks(category lang)
> <$list filter="[all[tiddlers]tag[$category$]tag[$lang$]]" variable="macO">
> <>
> 
> \end
>
> <$wikify name="wkfd" text="<>" >
> <$list variable="myList" filter="[enlist]">
> Auther of : <>  is {{{[get[auther]]}}}
> 
> 
>
> Any other implementation for the same functionality?
>
>
>
> On Tuesday, March 2, 2021 at 4:23:31 PM UTC+2 Mohamed Amin wrote:
>
>> Hi All,
>>
>> I've a set of tiddlers represent my books/novels, and I'm using the 
>> following Macro to filter my books by their "Category" and "Language" :
>>
>> \define myBooks(category lang)
>> <$list filter="[all[tiddlers]tag[$category$]tag[$lang$]]"/>
>> \end
>>
>> and when I run <> I got a "LIST" of my "English Novels" 
>> (which is working as expected)
>>
>> Now, my problem is when I try to use that Macro output as a "LIST" in 
>> other part of my code (to identify other properties like Authers, Rating, 
>> ...)
>>
>> for example, I tried the following :-
>>
>> <$wikify name="wkfd" text="<>" >
>> <$list variable="myList" filter="[enlist]">
>> <>
>> 
>> 
>>
>> but both "wkfd" and "myList" variables are NOT "LIST" to iterate with. 
>>
>> so, what is the correct way to use that macro output as a list?
>>
>> Regards
>>
>

-- 
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/567f4c29-8d09-4ddc-9bc8-f671ddc32bc9n%40googlegroups.com.


[tw5] Re: Macro: How convert wikified macro output as a "List"

2021-03-02 Thread Mohamed Amin
Ok, I figured it out (Thanks BTC 
)

\define prepEnlisting(nlst) 
$(macO)$
\end
\define myBooks(category lang)
<$list filter="[all[tiddlers]tag[$category$]tag[$lang$]]" variable="macO">
<>

\end

<$wikify name="wkfd" text="<>" >
<$list variable="myList" filter="[enlist]">
Auther of : <>  is {{{[get[auther]]}}}



Any other implementation for the same functionality?



On Tuesday, March 2, 2021 at 4:23:31 PM UTC+2 Mohamed Amin wrote:

> Hi All,
>
> I've a set of tiddlers represent my books/novels, and I'm using the 
> following Macro to filter my books by their "Category" and "Language" :
>
> \define myBooks(category lang)
> <$list filter="[all[tiddlers]tag[$category$]tag[$lang$]]"/>
> \end
>
> and when I run <> I got a "LIST" of my "English Novels" 
> (which is working as expected)
>
> Now, my problem is when I try to use that Macro output as a "LIST" in 
> other part of my code (to identify other properties like Authers, Rating, 
> ...)
>
> for example, I tried the following :-
>
> <$wikify name="wkfd" text="<>" >
> <$list variable="myList" filter="[enlist]">
> <>
> 
> 
>
> but both "wkfd" and "myList" variables are NOT "LIST" to iterate with. 
>
> so, what is the correct way to use that macro output as a list?
>
> Regards
>

-- 
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/e7278c0d-62ba-4744-bebc-d28d848892a6n%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-05 Thread Glenn Dixon
On Tuesday, January 5, 2021 at 5:55:27 PM UTC-5 TW Tones wrote:

> Dix,
>
> Since you mentioned it I had a look at LibraryThing, and started 
> cataloguing my books found in different locations "Rooms, shelves" since 
> the ISBN scanner is easy to use.
>
> Have you exported LibraryThing data? Eventually I may move this data into 
> tiddlywiki.
>

You can export to Excel, tab-delimited, JSON and Marc data (whatever that 
is)

https://www.librarything.com/more/import

Perhaps we should start a subject specific thread for libraries in 
> TiddlyWiki.
>
> Regards
> Tones
>

I would be interested still! :) 

-- 
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/7a2589df-299c-4c1e-b23c-862193337b74n%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-05 Thread TW Tones
Dix,

Since you mentioned it I had a look at LibraryThing, and started 
cataloguing my books found in different locations "Rooms, shelves" since 
the ISBN scanner is easy to use.

Have you exported LibraryThing data? Eventually I may move this data into 
tiddlywiki.

I am, off to our "shack in the bush" where I am am keen to record what is 
there, but in time I would like to make my own "little library" application 
on tiddlywiki,  so I can keep track of books moving between locations, 
needing reading and lending to friends. The apps out there never quite 
focus on what I want.

I have in the past use plugins and macros to link ISBN's to books and their 
metadata in tiddlywiki.

Perhaps we should start a subject specific thread for libraries in 
TiddlyWiki.

Regards
Tones

On Tuesday, 5 January 2021 at 01:15:34 UTC+11 dix...@gmail.com wrote:

> Thanks, but I've moved my book collection back online to LibraryThings. 
>
> On Monday, January 4, 2021 at 5:10:46 AM UTC-6 amreus wrote:
>
>> Hopefully this is helpful.  I also find the syntax arcane and still 
>> struggle with constructing code like the following. 
>>
>> \define makeimg()
>> <$vars 
>>   imgurl="http://covers.librarything.com/devkey/dev-key/medium/isbn/";
>>   fallback="[[Normal Link|http://google.com]]";
>>   isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}} 
>> >
>> <$list filter=<> emptyMessage=<>>
>>   <$image source={{{[addsuffix]}}}/>
>> 
>> 
>> \end
>>
>> <>
>>
>>
>> On Sunday, January 3, 2021 at 2:39:18 PM UTC-5 dix...@gmail.com wrote:
>>
>>> Thank you very much for your help!
>>>
>>> I guess I need to give up on this particular idea. There are only so 
>>> many hours I can spend struggling with something like this before I am 
>>> simply ready to ditch TiddlyWiki altogether. I really struggle with the 
>>> syntax. Depending on the context, I may need one, two or three curly 
>>> braces, or maybe '<' - or maybe '<<' - and I can't find any rhyme or reason 
>>> for these contexts. The documents seem to be written for someone familiar 
>>> with multiple programming languages. That's not me.
>>>
>>> I just need a simple if/then/else and that seems to require a lot of 
>>> strange workarounds. I guess I'll look for that elsewhere...
>>>
>>> On Sunday, January 3, 2021 at 11:20:57 AM UTC-6 saq.i...@gmail.com 
>>> wrote:
>>>
 Wrap the image part in a <$list> widget that tests whether isbn is 
 blank. You can use the emptyMessage attribute to show the plain URL 
 instead 
 when there is no isbn.

 On Sunday, January 3, 2021 at 4:10:44 PM UTC+1 dix...@gmail.com wrote:

> Yes, but I need a plain URL, not an image link, so wouldn't be able to 
> use <$image ...
>
> On Sunday, January 3, 2021 at 9:08:08 AM UTC-6 saq.i...@gmail.com 
> wrote:
>
>> The last example does that, it falls back to an entirely different 
>> URL if no ISBN fields exist. 
>>
>> On Sunday, January 3, 2021 at 3:59:03 PM UTC+1 dix...@gmail.com 
>> wrote:
>>
>>> This looks nice! It appears to put all the right code in the right 
>>> place. Now if only librarything servers would quit dying on me...
>>>
>>> Are there any other widgets with :filter and :else options that I 
>>> could use to do something similar w/ a link? Specifically, use isbn or 
>>> isbn13 in link, but if they don't exist show this *other* link? I've 
>>> been 
>>> using [ext[ link format, but need to do some if/then...
>>>
>>> On Sunday, January 3, 2021 at 8:38:38 AM UTC-6 saq.i...@gmail.com 
>>> wrote:
>>>
 Here is an example on falling back to the generic image if no ISBN 
 fields are defined

 \define makeimg()
 <$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}>
 <$image source={{{ [[
 http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix]
  
 :filter[!is[blank]] :else[[generic image URL]] }}}/>
 
 \end

 <>

>>>

-- 
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/8c66dbd2-e8d9-4732-bf43-a57011952b85n%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-04 Thread Glenn Dixon
Thanks, but I've moved my book collection back online to LibraryThings. 

On Monday, January 4, 2021 at 5:10:46 AM UTC-6 amreus wrote:

> Hopefully this is helpful.  I also find the syntax arcane and still 
> struggle with constructing code like the following. 
>
> \define makeimg()
> <$vars 
>   imgurl="http://covers.librarything.com/devkey/dev-key/medium/isbn/";
>   fallback="[[Normal Link|http://google.com]]";
>   isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}} 
> >
> <$list filter=<> emptyMessage=<>>
>   <$image source={{{[addsuffix]}}}/>
> 
> 
> \end
>
> <>
>
>
> On Sunday, January 3, 2021 at 2:39:18 PM UTC-5 dix...@gmail.com wrote:
>
>> Thank you very much for your help!
>>
>> I guess I need to give up on this particular idea. There are only so many 
>> hours I can spend struggling with something like this before I am simply 
>> ready to ditch TiddlyWiki altogether. I really struggle with the syntax. 
>> Depending on the context, I may need one, two or three curly braces, or 
>> maybe '<' - or maybe '<<' - and I can't find any rhyme or reason for these 
>> contexts. The documents seem to be written for someone familiar with 
>> multiple programming languages. That's not me.
>>
>> I just need a simple if/then/else and that seems to require a lot of 
>> strange workarounds. I guess I'll look for that elsewhere...
>>
>> On Sunday, January 3, 2021 at 11:20:57 AM UTC-6 saq.i...@gmail.com wrote:
>>
>>> Wrap the image part in a <$list> widget that tests whether isbn is 
>>> blank. You can use the emptyMessage attribute to show the plain URL instead 
>>> when there is no isbn.
>>>
>>> On Sunday, January 3, 2021 at 4:10:44 PM UTC+1 dix...@gmail.com wrote:
>>>
 Yes, but I need a plain URL, not an image link, so wouldn't be able to 
 use <$image ...

 On Sunday, January 3, 2021 at 9:08:08 AM UTC-6 saq.i...@gmail.com 
 wrote:

> The last example does that, it falls back to an entirely different URL 
> if no ISBN fields exist. 
>
> On Sunday, January 3, 2021 at 3:59:03 PM UTC+1 dix...@gmail.com wrote:
>
>> This looks nice! It appears to put all the right code in the right 
>> place. Now if only librarything servers would quit dying on me...
>>
>> Are there any other widgets with :filter and :else options that I 
>> could use to do something similar w/ a link? Specifically, use isbn or 
>> isbn13 in link, but if they don't exist show this *other* link? I've 
>> been 
>> using [ext[ link format, but need to do some if/then...
>>
>> On Sunday, January 3, 2021 at 8:38:38 AM UTC-6 saq.i...@gmail.com 
>> wrote:
>>
>>> Here is an example on falling back to the generic image if no ISBN 
>>> fields are defined
>>>
>>> \define makeimg()
>>> <$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}>
>>> <$image source={{{ [[
>>> http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix]
>>>  
>>> :filter[!is[blank]] :else[[generic image URL]] }}}/>
>>> 
>>> \end
>>>
>>> <>
>>>
>>

-- 
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/51f5e342-1e03-4f8f-802d-9d5326603c77n%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-04 Thread amreus
Hopefully this is helpful.  I also find the syntax arcane and still 
struggle with constructing code like the following. 

\define makeimg()
<$vars 
  imgurl="http://covers.librarything.com/devkey/dev-key/medium/isbn/";
  fallback="[[Normal Link|http://google.com]]";
  isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}} 
>
<$list filter=<> emptyMessage=<>>
  <$image source={{{[addsuffix]}}}/>


\end

<>


On Sunday, January 3, 2021 at 2:39:18 PM UTC-5 dix...@gmail.com wrote:

> Thank you very much for your help!
>
> I guess I need to give up on this particular idea. There are only so many 
> hours I can spend struggling with something like this before I am simply 
> ready to ditch TiddlyWiki altogether. I really struggle with the syntax. 
> Depending on the context, I may need one, two or three curly braces, or 
> maybe '<' - or maybe '<<' - and I can't find any rhyme or reason for these 
> contexts. The documents seem to be written for someone familiar with 
> multiple programming languages. That's not me.
>
> I just need a simple if/then/else and that seems to require a lot of 
> strange workarounds. I guess I'll look for that elsewhere...
>
> On Sunday, January 3, 2021 at 11:20:57 AM UTC-6 saq.i...@gmail.com wrote:
>
>> Wrap the image part in a <$list> widget that tests whether isbn is blank. 
>> You can use the emptyMessage attribute to show the plain URL instead when 
>> there is no isbn.
>>
>> On Sunday, January 3, 2021 at 4:10:44 PM UTC+1 dix...@gmail.com wrote:
>>
>>> Yes, but I need a plain URL, not an image link, so wouldn't be able to 
>>> use <$image ...
>>>
>>> On Sunday, January 3, 2021 at 9:08:08 AM UTC-6 saq.i...@gmail.com wrote:
>>>
 The last example does that, it falls back to an entirely different URL 
 if no ISBN fields exist. 

 On Sunday, January 3, 2021 at 3:59:03 PM UTC+1 dix...@gmail.com wrote:

> This looks nice! It appears to put all the right code in the right 
> place. Now if only librarything servers would quit dying on me...
>
> Are there any other widgets with :filter and :else options that I 
> could use to do something similar w/ a link? Specifically, use isbn or 
> isbn13 in link, but if they don't exist show this *other* link? I've been 
> using [ext[ link format, but need to do some if/then...
>
> On Sunday, January 3, 2021 at 8:38:38 AM UTC-6 saq.i...@gmail.com 
> wrote:
>
>> Here is an example on falling back to the generic image if no ISBN 
>> fields are defined
>>
>> \define makeimg()
>> <$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}>
>> <$image source={{{ [[
>> http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix]
>>  
>> :filter[!is[blank]] :else[[generic image URL]] }}}/>
>> 
>> \end
>>
>> <>
>>
>

-- 
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/d8c5b55c-4c92-4737-b630-15c89db21d37n%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-03 Thread Glenn Dixon
Thank you very much for your help!

I guess I need to give up on this particular idea. There are only so many 
hours I can spend struggling with something like this before I am simply 
ready to ditch TiddlyWiki altogether. I really struggle with the syntax. 
Depending on the context, I may need one, two or three curly braces, or 
maybe '<' - or maybe '<<' - and I can't find any rhyme or reason for these 
contexts. The documents seem to be written for someone familiar with 
multiple programming languages. That's not me.

I just need a simple if/then/else and that seems to require a lot of 
strange workarounds. I guess I'll look for that elsewhere...

On Sunday, January 3, 2021 at 11:20:57 AM UTC-6 saq.i...@gmail.com wrote:

> Wrap the image part in a <$list> widget that tests whether isbn is blank. 
> You can use the emptyMessage attribute to show the plain URL instead when 
> there is no isbn.
>
> On Sunday, January 3, 2021 at 4:10:44 PM UTC+1 dix...@gmail.com wrote:
>
>> Yes, but I need a plain URL, not an image link, so wouldn't be able to 
>> use <$image ...
>>
>> On Sunday, January 3, 2021 at 9:08:08 AM UTC-6 saq.i...@gmail.com wrote:
>>
>>> The last example does that, it falls back to an entirely different URL 
>>> if no ISBN fields exist. 
>>>
>>> On Sunday, January 3, 2021 at 3:59:03 PM UTC+1 dix...@gmail.com wrote:
>>>
 This looks nice! It appears to put all the right code in the right 
 place. Now if only librarything servers would quit dying on me...

 Are there any other widgets with :filter and :else options that I could 
 use to do something similar w/ a link? Specifically, use isbn or isbn13 in 
 link, but if they don't exist show this *other* link? I've been using 
 [ext[ 
 link format, but need to do some if/then...

 On Sunday, January 3, 2021 at 8:38:38 AM UTC-6 saq.i...@gmail.com 
 wrote:

> Here is an example on falling back to the generic image if no ISBN 
> fields are defined
>
> \define makeimg()
> <$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}>
> <$image source={{{ [[
> http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix]
>  
> :filter[!is[blank]] :else[[generic image URL]] }}}/>
> 
> \end
>
> <>
>


-- 
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/f824f9cf-834d-4364-92f5-659c91892291n%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-03 Thread Saq Imtiaz
Wrap the image part in a <$list> widget that tests whether isbn is blank. 
You can use the emptyMessage attribute to show the plain URL instead when 
there is no isbn.

On Sunday, January 3, 2021 at 4:10:44 PM UTC+1 dix...@gmail.com wrote:

> Yes, but I need a plain URL, not an image link, so wouldn't be able to use 
> <$image ...
>
> On Sunday, January 3, 2021 at 9:08:08 AM UTC-6 saq.i...@gmail.com wrote:
>
>> The last example does that, it falls back to an entirely different URL if 
>> no ISBN fields exist. 
>>
>> On Sunday, January 3, 2021 at 3:59:03 PM UTC+1 dix...@gmail.com wrote:
>>
>>> This looks nice! It appears to put all the right code in the right 
>>> place. Now if only librarything servers would quit dying on me...
>>>
>>> Are there any other widgets with :filter and :else options that I could 
>>> use to do something similar w/ a link? Specifically, use isbn or isbn13 in 
>>> link, but if they don't exist show this *other* link? I've been using [ext[ 
>>> link format, but need to do some if/then...
>>>
>>> On Sunday, January 3, 2021 at 8:38:38 AM UTC-6 saq.i...@gmail.com wrote:
>>>
 Here is an example on falling back to the generic image if no ISBN 
 fields are defined

 \define makeimg()
 <$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}>
 <$image source={{{ [[
 http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix]
  
 :filter[!is[blank]] :else[[generic image URL]] }}}/>
 
 \end

 <>

>>>

-- 
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/d837d5ea-0fd5-49e2-9dad-aba007264736n%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-03 Thread Glenn Dixon
Yes, but I need a plain URL, not an image link, so wouldn't be able to use 
<$image ...

On Sunday, January 3, 2021 at 9:08:08 AM UTC-6 saq.i...@gmail.com wrote:

> The last example does that, it falls back to an entirely different URL if 
> no ISBN fields exist. 
>
> On Sunday, January 3, 2021 at 3:59:03 PM UTC+1 dix...@gmail.com wrote:
>
>> This looks nice! It appears to put all the right code in the right place. 
>> Now if only librarything servers would quit dying on me...
>>
>> Are there any other widgets with :filter and :else options that I could 
>> use to do something similar w/ a link? Specifically, use isbn or isbn13 in 
>> link, but if they don't exist show this *other* link? I've been using [ext[ 
>> link format, but need to do some if/then...
>>
>> On Sunday, January 3, 2021 at 8:38:38 AM UTC-6 saq.i...@gmail.com wrote:
>>
>>> Here is an example on falling back to the generic image if no ISBN 
>>> fields are defined
>>>
>>> \define makeimg()
>>> <$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}>
>>> <$image source={{{ [[
>>> http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix]
>>>  
>>> :filter[!is[blank]] :else[[generic image URL]] }}}/>
>>> 
>>> \end
>>>
>>> <>
>>>
>>

-- 
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/d3ee0681-8648-4dc9-844f-f956181bcb6an%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-03 Thread Saq Imtiaz
The last example does that, it falls back to an entirely different URL if 
no ISBN fields exist. 

On Sunday, January 3, 2021 at 3:59:03 PM UTC+1 dix...@gmail.com wrote:

> This looks nice! It appears to put all the right code in the right place. 
> Now if only librarything servers would quit dying on me...
>
> Are there any other widgets with :filter and :else options that I could 
> use to do something similar w/ a link? Specifically, use isbn or isbn13 in 
> link, but if they don't exist show this *other* link? I've been using [ext[ 
> link format, but need to do some if/then...
>
> On Sunday, January 3, 2021 at 8:38:38 AM UTC-6 saq.i...@gmail.com wrote:
>
>> Here is an example on falling back to the generic image if no ISBN fields 
>> are defined
>>
>> \define makeimg()
>> <$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}>
>> <$image source={{{ [[
>> http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix]
>>  
>> :filter[!is[blank]] :else[[generic image URL]] }}}/>
>> 
>> \end
>>
>> <>
>>
>

-- 
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/5f3c7b00-065d-401b-a595-81b9f1a73f27n%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-03 Thread Glenn Dixon
This looks nice! It appears to put all the right code in the right place. 
Now if only librarything servers would quit dying on me...

Are there any other widgets with :filter and :else options that I could use 
to do something similar w/ a link? Specifically, use isbn or isbn13 in 
link, but if they don't exist show this *other* link? I've been using [ext[ 
link format, but need to do some if/then...

On Sunday, January 3, 2021 at 8:38:38 AM UTC-6 saq.i...@gmail.com wrote:

> Here is an example on falling back to the generic image if no ISBN fields 
> are defined
>
> \define makeimg()
> <$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}>
> <$image source={{{ [[
> http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix]
>  
> :filter[!is[blank]] :else[[generic image URL]] }}}/>
> 
> \end
>
> <>
>

-- 
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/3592f222-bdc1-422b-9221-b89ad6f5b6b3n%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-03 Thread Saq Imtiaz
Here is an example on falling back to the generic image if no ISBN fields 
are defined

\define makeimg()
<$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}>
<$image source={{{ 
[[http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix]
 
:filter[!is[blank]] :else[[generic image URL]] }}}/>

\end

<>

-- 
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/b9b910a8-3b9b-442a-9e01-ed08c7989e1fn%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-03 Thread Saq Imtiaz
One option would be to call your macro like this: 
<$macrocall $name="makeimg" isbn={{{ [{!!isbn}!is[blank]else{!!isbn13}] }}} 
/>

This would be simpler:

\define makeimg()
<$vars isbn={{{[{!!isbn}!is[blank]else{!!isbn13}]}}}>
<$image source={{{ 
[[http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/]addsuffix]
 
}}}/>

\end

<>

For the generic book image fallback it depends on whether that is also a 
remote image or a local one.

On Sunday, January 3, 2021 at 2:34:53 PM UTC+1 dix...@gmail.com wrote:

> My brain is obviously incapable of understanding TW documentation. Any 
> way, here is the code
>
> \define makeimg(isbn) [img[
> http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/$isbn$
> ]]
>
> <$macrocall $name="makeimg" isbn={{!!isbn}} />
>
> I need to basically add options for "if no isbn, use isbn13. If neither, 
> then use this generic book cover image"
>
> isbn and isbn13 are both fields - when I imported, if the field was empty, 
> the field was not set up in the tiddler, so it's not a blank field, it's a 
> non-existent field. Half my books have one or the other, some have both, 
> some have neither.
>
> Something like that...
>
> On Sunday, January 3, 2021 at 7:09:24 AM UTC-6 saq.i...@gmail.com wrote:
>
>> Sounds like something I would do either with filters use the else[] 
>> operator, or with nested <$view> widgets (where the content of a view 
>> widget is only displayed if the target field is absent).
>>
>> https://tiddlywiki.com/#ViewWidget
>>
>> Hard to be more specific without seeing your code.
>>
>> On Sunday, January 3, 2021 at 1:32:35 PM UTC+1 dix...@gmail.com wrote:
>>
>>>
>>> I have a working macro, but just realized that the field it uses is 
>>> sometimes not present. There is an alternate field I would like to use in 
>>> its place. I also need to use a 'dummy' result if *both* fields are not 
>>> present.
>>>
>>> My dozens of searches through TW documentation and this group have so 
>>> far proven futile. Could use some help...
>>>
>>>

-- 
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/c52ead92-539d-417c-a164-c433d7cbf2een%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-03 Thread Glenn Dixon
My brain is obviously incapable of understanding TW documentation. Any way, 
here is the code

\define makeimg(isbn) 
[img[http://covers.librarything.com/devkey/dev-key-goes-here/medium/isbn/$isbn$]]

<$macrocall $name="makeimg" isbn={{!!isbn}} />

I need to basically add options for "if no isbn, use isbn13. If neither, 
then use this generic book cover image"

isbn and isbn13 are both fields - when I imported, if the field was empty, 
the field was not set up in the tiddler, so it's not a blank field, it's a 
non-existent field. Half my books have one or the other, some have both, 
some have neither.

Something like that...

On Sunday, January 3, 2021 at 7:09:24 AM UTC-6 saq.i...@gmail.com wrote:

> Sounds like something I would do either with filters use the else[] 
> operator, or with nested <$view> widgets (where the content of a view 
> widget is only displayed if the target field is absent).
>
> https://tiddlywiki.com/#ViewWidget
>
> Hard to be more specific without seeing your code.
>
> On Sunday, January 3, 2021 at 1:32:35 PM UTC+1 dix...@gmail.com wrote:
>
>>
>> I have a working macro, but just realized that the field it uses is 
>> sometimes not present. There is an alternate field I would like to use in 
>> its place. I also need to use a 'dummy' result if *both* fields are not 
>> present.
>>
>> My dozens of searches through TW documentation and this group have so far 
>> proven futile. Could use some help...
>>
>>

-- 
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/7fa984d4-f124-4857-a853-1100a6cbd5ban%40googlegroups.com.


[tw5] Re: macro for 'if field exists then A else B else C' ???

2021-01-03 Thread Saq Imtiaz
Sounds like something I would do either with filters use the else[] 
operator, or with nested <$view> widgets (where the content of a view 
widget is only displayed if the target field is absent).

https://tiddlywiki.com/#ViewWidget

Hard to be more specific without seeing your code.

On Sunday, January 3, 2021 at 1:32:35 PM UTC+1 dix...@gmail.com wrote:

>
> I have a working macro, but just realized that the field it uses is 
> sometimes not present. There is an alternate field I would like to use in 
> its place. I also need to use a 'dummy' result if *both* fields are not 
> present.
>
> My dozens of searches through TW documentation and this group have so far 
> proven futile. Could use some help...
>
>

-- 
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/553577f3-c781-4aaf-9582-4a8a1169ba71n%40googlegroups.com.


[tw5] Re: [Macro] datauri macro and svg images

2020-12-14 Thread Joshua Fontany
Interesting... I wonder if this is true for all SVGs or just the core. The 
core image tiddlers are not actually "type:image/svg+xml", they do not have 
a type value, and are interpreted as wiki-text when transcluded.

Best,
Joshua F


On Wednesday, December 9, 2020 at 1:33:52 AM UTC-8 Mohammad wrote:

> I tried to use an svg as background. I realized I cannot use core svg 
> images. One reason may be the tiddler type or perhaps the removed xlmns.
>
> See below example at 
>
>  .jack { background: url(<$macrocall $name="datauri" title="Motovun 
> Jack.jpg" $output="text/plain"/>); height: 300px; }   class="jack"/> 
>
> Now if I replcae  Motovun Jack.jpg with $:/core/images/close-button as 
> below
>
>  .jack { background: url(<$macrocall $name="datauri" title="Motovun 
> Jack.jpg" $output="text/plain"/>); height: 300px; }   class="jack"/>  
>
> It does not work! 
>
> What is the reason?
>
> --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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4236b4d1-5bdc-4e9f-b418-5717ced3c4edn%40googlegroups.com.


[tw5] Re: Macro

2020-12-04 Thread TW Tones
Do explain why you want a macro,
Is it for reusable code?

I will provide a different solution to yours once I understand more. I did 
learn by reviewing the core buttons in tiddlywiki, search the shadow 
tiddlers, they can be simplified further.

It seems to me in this case the macro is almost as "verbose" as the button 
widget. Sometimes pasting a snippet is just as quick.

I also tend get many of the values used from elsewhere, such as fields and 
variables, you will need to use the macrocall widget to do this.

Regards
Tones


On Saturday, 5 December 2020 at 03:50:45 UTC+11 vinvi...@gmail.com wrote:

> Hello,
>
> I have a question about creating a macro.
> https://tiddlywiki.com/static/Macros%2520in%2520WikiText.html
>
> I have to make a lot of buttons in my wiki and I have this code for a 
> button for creating a new tiddler; (It works fine.)
>
> `<$button><$action-sendmessage 
> $message="tm-new-tiddler" title=<> 
> tags="TAG-NAME-HERE" tags show="TAG-NAME-HERE" text="TEXT-HERE" 
> comment="FIELD-COMMENT-HERE"/> style="color:blue;">''BUTTON-NAME-HERE''`
>
> How do I convert the above code into a macro?
>
> This is my attempt, but I can't get it done:
>
> `\define NEW-TIDDLER(now format:"XXX" 
> tags:"XXX" tags show:"XXX" text:"XXX" comment:"XXX")
> <$button><$action-sendmessage 
> $message="tm-new-tiddler" title=<<$now format:$>> $tags$ $tags show$ $text$ 
> $comment$/> style="color:blue;">''BUTTON-NAME-HERE''
> \end
>
> < now format:"XXX" 
> tags:"XXX" 
> tags show:"XXX" 
> text:"XXX" 
> comment:"XXX" 
> ">>`
>
> Thank you,
>
>
>
>

-- 
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/1ac88fb4-1eb9-47f8-8900-739ae9b461ean%40googlegroups.com.


[tw5] Re: Macro

2020-12-04 Thread 'Mark S.' via TiddlyWiki
You can't use a parameter with spaces in the name (e.g., you can't use "now 
format" as a parameter). You also can't create field names with spaces in 
them.

Substituting hyphens for spaces, and a few other changes, this might be 
closer to what you want:

\define NEW-TIDDLER(now-format:"XXX" 
tags:"XXX" tags-show:"XXX" text:"XXX" comment:"XXX")
<$button><$action-sendmessage 
$message="tm-new-tiddler" title=<> tags="""$tags$""" 
tags-show="""$tags-show$""" text="""$text$""" 
comment="""$comment$"""/>''BUTTON-NAME-HERE''
\end

<>




On Friday, December 4, 2020 at 8:50:45 AM UTC-8 vinvi...@gmail.com wrote:

> Hello,
>
> I have a question about creating a macro.
> https://tiddlywiki.com/static/Macros%2520in%2520WikiText.html
>
> I have to make a lot of buttons in my wiki and I have this code for a 
> button for creating a new tiddler; (It works fine.)
>
> `<$button><$action-sendmessage 
> $message="tm-new-tiddler" title=<> 
> tags="TAG-NAME-HERE" tags show="TAG-NAME-HERE" text="TEXT-HERE" 
> comment="FIELD-COMMENT-HERE"/> style="color:blue;">''BUTTON-NAME-HERE''`
>
> How do I convert the above code into a macro?
>
> This is my attempt, but I can't get it done:
>
> `\define NEW-TIDDLER(now format:"XXX" 
> tags:"XXX" tags show:"XXX" text:"XXX" comment:"XXX")
> <$button><$action-sendmessage 
> $message="tm-new-tiddler" title=<<$now format:$>> $tags$ $tags show$ $text$ 
> $comment$/> style="color:blue;">''BUTTON-NAME-HERE''
> \end
>
> < now format:"XXX" 
> tags:"XXX" 
> tags show:"XXX" 
> text:"XXX" 
> comment:"XXX" 
> ">>`
>
> Thank you,
>
>
>
>

-- 
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/4d191a48-d9d9-444d-b798-651e6285727en%40googlegroups.com.


[tw5] Re: macro definition

2020-09-17 Thread TW Tones
Also,

An empty define of the form
\define name()
\end

or

\define name()

\end
Will cause problems

However
\define note() Note in macros
\define note()
Some notes
\end
Thus redefining, is the best option for in line comments.

Also there is now a new tag
SystemTag: $:/tags/Macro/View 


The system tag  $:/tags/Macro/View marks 
macros that are only made available within the main view templates and the 
preview panel.

Content after the last define is ignored when macros are accesses due to a 
tag

Regards
Tones

On Thursday, 17 September 2020 17:24:58 UTC+10, Felicia Crow wrote:
>
> Hi,
>
> yes as long as all the macros are defined at the beginning of the tiddler. 
> Empty lines to seperate the individual tiddlers work, but everything else 
> in between will trip tiddlywiki up and won't let it recognize the \define 
> following.
>
> Regards,
> Felicia
>
>
>
> On Thursday, 17 September 2020 08:47:22 UTC+2, Bob Jansen wrote:
>>
>> Can I define more than one macro in a tiddler and have them all available 
>> by tagging the tiddler with $:/tags/Macro or does it have to be one macro 
>> definition per tiddler?
>>
>> bobj
>>
>

-- 
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/67c8e133-c3df-4560-9638-8c34ca21906fo%40googlegroups.com.


[tw5] Re: macro definition

2020-09-17 Thread Felicia Crow
Hi,

yes as long as all the macros are defined at the beginning of the tiddler. 
Empty lines to seperate the individual tiddlers work, but everything else 
in between will trip tiddlywiki up and won't let it recognize the \define 
following.

Regards,
Felicia



On Thursday, 17 September 2020 08:47:22 UTC+2, Bob Jansen wrote:
>
> Can I define more than one macro in a tiddler and have them all available 
> by tagging the tiddler with $:/tags/Macro or does it have to be one macro 
> definition per tiddler?
>
> bobj
>

-- 
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/97e64c42-8a5c-4083-a1a5-1dd50de6d217o%40googlegroups.com.


[tw5] Re: Macro Call : Passing TiddlerName with quotations

2020-08-25 Thread Rob Hoelz
Hi Mohamed,

I think an alternative would be the "Parameters as Variables" syntax 
described here  
- with that, your macro would look like this:

> \define getWithStatus(myStatus)
> <$set name="myStatus" value=<<__myStatus__>> >
> <$list filter="[all[tiddlers]field:status]">
>
> <>
> 
> 
>
> \end

On Tuesday, August 25, 2020 at 9:57:28 AM UTC-5 PMario wrote:

> On Tuesday, August 25, 2020 at 1:14:25 PM UTC+2, Mohamed Amin wrote:
>>
>> Thanks PMario for your comment,
>>
>> Actually the above were not a "real" values, just a way to present my 
>> issue, in real word I'm using True/False or Yes/No (but your suggestion 
>> "ok"/"nok" are very nice too) 
>>
>
> yes / no is also used by TW for several settings, because true / false ... 
> seemed to be to "techy" ;) IMO yes and no are good! I just wanted to point 
> out, that "terms" with no spaces are easier to handle. 
>
> -m
>

-- 
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/c71ad93a-4036-4380-b7a8-922b7166056dn%40googlegroups.com.


[tw5] Re: Macro Call : Passing TiddlerName with quotations

2020-08-25 Thread PMario
On Tuesday, August 25, 2020 at 1:14:25 PM UTC+2, Mohamed Amin wrote:
>
> Thanks PMario for your comment,
>
> Actually the above were not a "real" values, just a way to present my 
> issue, in real word I'm using True/False or Yes/No (but your suggestion 
> "ok"/"nok" are very nice too) 
>

yes / no is also used by TW for several settings, because true / false ... 
seemed to be to "techy" ;) IMO yes and no as good! I just wanted to point 
out, that "terms" with no spaces are easier to handle. 

-m

-- 
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/94cdb10b-dcaa-4d30-bb1b-ff7d5ecc4c57o%40googlegroups.com.


[tw5] Re: Macro Call : Passing TiddlerName with quotations

2020-08-25 Thread Mohamed Amin
Thanks PMario for your comment,

Actually the above were not a "real" values, just a way to present my 
issue, in real word I'm using True/False or Yes/No (but your suggestion 
"ok"/"nok" are very nice too) 

Thanks again
On Tuesday, August 25, 2020 at 12:33:55 PM UTC+2 PMario wrote:

> Hi Mohammad, 
>
> I'd use much simpler values for the status eg: OK and NOK or ok and nok, 
> which are fast to type and easy to test. 
>
> just a thought.
>
> 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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f4c577f4-4e35-45ae-82f9-fe746a8451e8n%40googlegroups.com.


[tw5] Re: Macro Call : Passing TiddlerName with quotations

2020-08-25 Thread PMario
Hi Mohammad, 

I'd use much simpler values for the status eg: OK and NOK or ok and nok, 
which are fast to type and easy to test. 

just a thought.

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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3d0d053c-20ac-4ee0-b74d-233a1fe2eb66o%40googlegroups.com.


[tw5] Re: Macro Call : Passing TiddlerName with quotations

2020-08-24 Thread Mohamed Amin
Thanks a lot Saq and Eric,
 
YES that was the problem, and using the tripled-quotes solved it 
immediately 

P.S:
I've using TW5 for almost a year now, and every day I know a new (and 
strange) thing about this AMAZING piece of software.
Thanks to all contributions & Community 

On Monday, August 24, 2020 at 10:51:05 PM UTC+2 Eric Shulman wrote:

> On Monday, August 24, 2020 at 1:41:42 PM UTC-7, Mohamed Amin wrote:
>>
>> ... I've a simple Macro to get all Tiddler by "status" :
>>
> \define getWithStatus(myStatus)
>> <$list filter="[all[tiddlers]contains:status[$myStatus$]]" />
>> \end
>> As expected, when I run the below macro command:
>> <>
>>
> The output is OK...
>>
> BUT, my problem when I run the following :
>> <>
>>
> I've tried both """_""", and '_' for the parameter :-
>>
>
> The problem is how you quote the filter inside the macro.  Use the 
> tripled-quotes like this:
> \define getWithStatus(myStatus)
> <$list filter="""[all[tiddlers]contains:status[$myStatus$]]""" />
> \end
>
> Then, the value of $myStatus$ can contain quotes without a problem.
>
> -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/fcd4a978-d5cc-4c2a-b6c4-1277ca22db16n%40googlegroups.com.


[tw5] Re: Macro Call : Passing TiddlerName with quotations

2020-08-24 Thread Eric Shulman
On Monday, August 24, 2020 at 1:41:42 PM UTC-7, Mohamed Amin wrote:
>
> ... I've a simple Macro to get all Tiddler by "status" :
> \define getWithStatus(myStatus)
> <$list filter="[all[tiddlers]contains:status[$myStatus$]]" />
> \end
> As expected, when I run the below macro command:
> <>
> The output is OK...
> BUT, my problem when I run the following :
> <>
> I've tried both """_""", and '_' for the parameter :-
>

The problem is how you quote the filter inside the macro.  Use the 
tripled-quotes like this:
\define getWithStatus(myStatus)
<$list filter="""[all[tiddlers]contains:status[$myStatus$]]""" />
\end

Then, the value of $myStatus$ can contain quotes without a problem.

-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/c116036f-c9fe-489c-bafb-a2ffdd619568o%40googlegroups.com.


[tw5] Re: Macro Call : Passing TiddlerName with quotations

2020-08-24 Thread Saq Imtiaz
Try triple quotes around the list filter:

<$list filter="""[all[tiddlers]contains:status[$myStatus$]]""" />  

On Monday, August 24, 2020 at 10:41:42 PM UTC+2 Mohamed Amin wrote:

> Hello All,
>
> Appreciate you help regarding my below issue:
>
> Suppose that I've a set of Tiddlers called "Recipes" ( Recipe01, Recipe02, 
> .) where each of them has a field called "status"
>
> Where:
> {{Recipe01!!status}} = [[This is OK]]
> {{Recipe02!!status}} = [[This is OK]]
> {{Recipe03!!status}} = [[This is OK]]
> {{Recipe04!!status}} = [[This is "Not" OK]]
> {{Recipe05!!status}} = [[This is "Not" OK]]
>
> Also, I've a simple Macro to get all Tiddler by "status" :
>
> ```
> \define getWithStatus(myStatus)
> <$list filter="[all[tiddlers]contains:status[$myStatus$]]" />
>
> \end
> ```
>
> As expected, when I run the below macro command:
> <>
>
> The output is OK, I got :-
> Recipe01
> Recipe02
> Recipe03
>
> BUT, my problem when I run the following :
> <>
>
> where the output is (the macro content with substitution of parameter) :-
> ```
> <$list filter="[all[tiddlers]contains:status[This is "Not" OK]]" />
> ```
>
> Thanks in Advance
>
> P.S, I've tried both """_""", and '_' for the parameter :-
> <>
> <>
>
> but I got the same output, 
>

-- 
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/294cecd9-82e8-40ce-a8fb-7e822acb66c2n%40googlegroups.com.


[tw5] Re: Macro only loading when viewing.

2020-07-23 Thread Jeff W
Just an update. Solution(s) 
 are here 
if needed in the future.

On Sunday, July 19, 2020 at 2:18:00 PM UTC-5, Jeff W wrote:
>
> Hey folks,
>
> I've incorporated, into my Noteself usage, the ximg macro located here->  
> [External Image Path Macro](
> http://www.richshumaker.com/tw5/tw-photo.html#External%20Image%20Path)
>
> It works great and works when I view a tiddler using the markup.
>
> I have since modified the approach (created new tiddlers) to create 
> essentially an External Link Path Macro (xpdf). My modified macro xpdf is 
> intended to allow external links to open pdfs. The macro seems to work, but 
> only when I perform the following:
>
>1. advance search for the macro
>2. select the xpdf macro
>3. when the tiddler appears (I don't have to open the edit window) the 
>tiddlers that are using the macro work.
>
> Here's what I've got in the tiddler:
>
> A tiddler named "$:/macros/xpdf" and tagged "$:/tags/Macro" with the 
> following content
>
> 
> \define pdfAtPath(t, y, d, p)
> [ext[$t$|$p$$y$ JBW/$d$]]
> \end
>
> \define xpdf(title, year, doc, path:"$:/macros/xpdf/path")
> <$macrocall $name="pdfAtPath" p={{$path$}} t="$title$" y="$year$" d=
> "$doc$"/>
> \end
>
> Another tiddler named "$:/macros/xpdf/path" and tagged "$:/tags/Macro" 
> with the following content
>
> ./JBW Notes Chrono/
>
> In the tiddler calling the macro, the following notation is used:
>
> <>
>
>
> Some other data (if needed).
>
>- Mac OS 10.15.5
>- Latest Noteself install 5.1.21
>- I have a local CouchDB (3.1.0) instance running
>- I have a remote CouchDB (2.3.1) instance running
>- This DB is replicating to and from each CouchDB instance
>
> The Questions...
>
>- Does anyone see any reason why the xpdf macro would need the extra 
>step?
>- Would the ximg and xpdf conflict with each other? (They both appear 
>to work once the xpdf macro is viewed)
>- Are there certain variables that I need to change because they are 
>unique (I wouldn't think this to be true)
>- Anyone have any ideas on how to fix it?
>
> Thanks in advance,
>

-- 
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/e097e066-2a46-457a-bb7d-4406a3ec7a9ao%40googlegroups.com.


[tw5] Re: Macro recursion runs out of control without reason

2020-07-20 Thread Mat
Mark Green wrote:
>
> Thanks! That actually fixed it! I wonder why it was recursing at all with 
> invalid syntax?
>

Prolly because <> does also have a closure but it 
is all the way over here. 

<:-)

-- 
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/2c2e8859-c2fc-45ae-8236-4eed91d0fbdfo%40googlegroups.com.


[tw5] Re: Macro recursion runs out of control without reason

2020-07-20 Thread TW Tones
Mark

Examples that can be installed and work on tiddlywiki.com or empty.html 
would help us work with you. See how you go after correcting the current 
tiddler.

In macros the previous current tiddler value is available with 
$(currentTiddler)$ so you do not have to pass it as a parameter.

Regards
Tony

On Tuesday, July 21, 2020 at 6:17:34 AM UTC+10, Mark Green wrote:
>
> For those who have been following my efforts with mod- fields, this is the 
> next chapter - thanks for all the help so far!
>
> Currently, ModifierBlockMacro contains:
>
> \define innermodifierblock(for:"")
> $for$
> <$set name="x" value=<<__for__>> >
> <$set name="mfield" filter="[titlelowercase[]split[ 
> ]join[_]addprefix[mod-]]">
> <$list filter="[all[tiddlers]has]">
> <$link/><><$view field=<> />
> <>
> 
> 
> 
> \end
>
> \define ModifierBlock(for:"")
> 
> <>
> 
> \end
>
> Tiddler ModifierBlockTest contains <> and has no 
> fields.
>
> Tiddler InheritModTest contains no text but has field mod-test: Level1.
> Tiddler InheritModTest1 contains no text but has field mod-inheritmodtest: 
> Level 2.
>
> So what should happen is:
> <> runs
> It adds InheritModTest to the list because of its mod-test
> <> runs
> It adds InheritModTest1 to the list because of its mod-inheritmodtest
> <> runs
> It adds nothing to the list because there is no mod-inheretmodtest1 
> anywhere
> <> ends
> <> ends
> <> ends
>
> What actually happens is that TiddlyWiki crashes with an infinite 
> recursion error, constantly repeating the first line of the list with 
> "InheritModTest - test - level1" on it, followed by "InheritModTest" as it 
> indicates the start of the new loop. It seems that it is confusing the two 
> $list s running in different recursive scopes. Is there any way around this?
>
>

-- 
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/31d64903-5d61-473e-bd77-9183e01c2e98o%40googlegroups.com.


[tw5] Re: Macro recursion runs out of control without reason

2020-07-20 Thread Mark Green
Thanks! That actually fixed it! I wonder why it was recursing at all with 
invalid syntax?

-- 
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/f8b53e87-d8cf-4f42-8a4a-16f936ce5e42o%40googlegroups.com.


[tw5] Re: Macro recursion runs out of control without reason

2020-07-20 Thread Eric Shulman
On Monday, July 20, 2020 at 1:17:34 PM UTC-7, Mark Green wrote:
>
> For those who have been following my efforts with mod- fields, this is the 
> next chapter - thanks for all the help so far!
>

The logic in your code is a bit hard to follow.  Still... just looking at 
syntax issues, I note this line: 

> <>
>

Even without comprehending the logic, it seems like what you are trying to 
do is to
invoke the "innermodifierblock" macro with a parameter which is the value 
of <>.

But, the above line has mis-matched angle brackets.  As a result what you 
are actually
doing is invoking "innermodifierblock" with a literal text parameter of 
"<> >>

But that won't work either, because you can't "nest" the double-angle 
brackets
when calling a macro (the parser just doesn't work that way).

To pass the <> value as a param, you would need to use the 
*widget* form of macrocall:
<$macrocall $name="innermodifierblock" for=<> />

Again... I'm just noting a *syntax* issue.  It's not clear to me if you 
have any
logic errors in the way things are coded... but perhaps the above 
information
will help you get where you are trying to go.

-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/0c104673-0fab-442d-8714-49c2f09bf544o%40googlegroups.com.


[tw5] Re: Macro recursion runs out of control without reason

2020-07-20 Thread 'Mark S.' via TiddlyWiki
This line

<>

is lacking a closing >> . However, I don't think you can feed a macro to a 
macro that way. At least I've never been able to. You probably need to use 
the macrocall widget:

<$macrocall $name="innermodifierblock" for=??? />

I have ??? since I don't know what parameters you want "for" to contain.

Good luck!

On Monday, July 20, 2020 at 1:17:34 PM UTC-7, Mark Green wrote:
>
> For those who have been following my efforts with mod- fields, this is the 
> next chapter - thanks for all the help so far!
>
> Currently, ModifierBlockMacro contains:
>
> \define innermodifierblock(for:"")
> $for$
> <$set name="x" value=<<__for__>> >
> <$set name="mfield" filter="[titlelowercase[]split[ 
> ]join[_]addprefix[mod-]]">
> <$list filter="[all[tiddlers]has]">
> <$link/><><$view field=<> />
> <>
> 
> 
> 
> \end
>
> \define ModifierBlock(for:"")
> 
> <>
> 
> \end
>
> Tiddler ModifierBlockTest contains <> and has no 
> fields.
>
> Tiddler InheritModTest contains no text but has field mod-test: Level1.
> Tiddler InheritModTest1 contains no text but has field mod-inheritmodtest: 
> Level 2.
>
> So what should happen is:
> <> runs
> It adds InheritModTest to the list because of its mod-test
> <> runs
> It adds InheritModTest1 to the list because of its mod-inheritmodtest
> <> runs
> It adds nothing to the list because there is no mod-inheretmodtest1 
> anywhere
> <> ends
> <> ends
> <> ends
>
> What actually happens is that TiddlyWiki crashes with an infinite 
> recursion error, constantly repeating the first line of the list with 
> "InheritModTest - test - level1" on it, followed by "InheritModTest" as it 
> indicates the start of the new loop. It seems that it is confusing the two 
> $list s running in different recursive scopes. Is there any way around this?
>
>

-- 
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/2e110285-432e-4c56-b0ff-dd01ad535382o%40googlegroups.com.


[tw5] Re: Macro for exporting multiple tiddlers as zip file

2020-07-08 Thread TW Tones
Mark,

Thanks for sharing. 

This solution of yours works well, I was playing with the zip function as 
well, It has a lot of potential.

   - Its easier to email zips than html etc...
   - On a read only wiki a user undertakes a survey and on completion 
   presses a button to zip their answers which they email to the people 
   undertaking the survey
   - A special import process could collate multiple responses rather than 
   overwrite them.
   - Ideally we could click to email with the zip attached without download.

I think a Zip exporter would also make sense but it exposes a gap, you can 
export the current tiddler, OR *export all* from the PageControl Export 
button, but no buttons allow us to select or provide additional information 
before actioning them.So its hard to pass a filter into them. The only 
choice is to go to Advanced Search Filter.

Input accepting buttons would be a nice little project.

Thanks again for this.
Regards
Tony

On Thursday, July 9, 2020 at 9:04:30 AM UTC+10, Mark S. wrote:
>
> I was thinking of export options for NoteWritey, when I remembered that TW 
> 5.1.23 will have a new zip plugin update. In fact, it actually works now in 
> 5.1.22 if you drag and drop  in the jszip plugin from the prerelease. Well, 
> I think it does.
>
> As you may know, when you try to export multiple tiddlers in the "tid" 
> format, you only get one tiddler as output. With the following code, you 
> can export multiple tiddlers packed into a zip file which you can then 
> extract using your favorite zip manager.
>
> I'm sure over time people will come up with much more clever uses for the 
> zip plugin, but in the meantime, here's a first stab. The macro takes a 
> filter, and output name, and title for the button.
>
>
> \define ziptid(filter: "[all[tiddlers]]" , output: "tiddlers.zip" , 
> title:"Make 
> Zip")
> <$button> $title$
> <$vars ziptid="$:/temp/zip">
> <$action-sendmessage $message="tm-zip-create" $param=<>/>
>
> <$vars sys="$:/" >
> <$list filter="""$filter$""">
> <$vars 
> fname={{{[splitjoin[_]split[/]join[_]addsuffix[.tid]] 
> }}} >
> <$action-sendmessage $message="tm-zip-render-file" $param=<> 
> filename=<> tiddler=<> template="$:/core/templates/
> tid-tiddler" mode="block" output="text/plain"/>
> 
> 
> 
> <$action-sendmessage $message="tm-zip-download" $param=<> 
> filename="""$output$"""/>
>
> 
> 
> \end
>
> <>
>
>
>

-- 
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/946d3281-091a-4b2a-a555-d88fc2ba27c1o%40googlegroups.com.


[tw5] Re: [Macro] cross-list-links-draggable

2020-05-14 Thread Mat
Tony K wrote:
>
> Macro 
> https://akhater.github.io/drift/#%24%3A%2Fak%2Fdrift%2Fmacros%2Fcross-list-links-draggable
>
> example: https://akhater.github.io/drift/#Week
>

OH! This is super! 

Detail, the demo it is clearer if you just put it in a table, i.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/4472c918-a4f3-4499-9c82-94bf05ecd28b%40googlegroups.com.


[tw5] Re: [Macro] cross-list-links-draggable

2020-05-14 Thread David Gifford
Added this to the lists section of the toolmap!

On Thursday, May 14, 2020 at 12:44:43 AM UTC-5, Tony K wrote:
>
>  I needed a way to be able to drag and drop items across lists while still 
> be able to re-order items inside the list so I modified the built 
> in list-links-draggable macro to fit my needs
>
> sharing it in case any one needs it 
>
> Macro 
> https://akhater.github.io/drift/#%24%3A%2Fak%2Fdrift%2Fmacros%2Fcross-list-links-draggable
>
> example: https://akhater.github.io/drift/#Week
>
> Baked in the latest version of Drift 
> 
>

-- 
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/66d82c80-ece8-4a77-86d1-68b98556fc46%40googlegroups.com.


[tw5] Re: [Macro] Spoiler Text

2020-05-14 Thread David Gifford
I added this to the popus section of the Toolmap, and the Educational aids 
section. https://dynalist.io/d/zUP-nIWu2FFoXH-oM7L7d9DM

On Thursday, May 14, 2020 at 12:48:14 AM UTC-5, Tony K wrote:
>
> Building something like "flash cards" I needed to hide a text and see if 
> my kinds can remember it etc...
>
> long story short keeping on using buttons and reveal got tiresome so I did 
> a small macro I called "Spoiler text" that hides a text behind [...] and 
> can be expanded
>
> Sharing it in case it helps someone
>
> Macro 
> https://akhater.github.io/drift/#%24%3A%2Fak%2Fdrift%2Fmacros%2Fspoiler
> Example https://akhater.github.io/drift/#Example%3A%20Spoiler
>
> Also baked into Drift 
>  
>
> Nice day everyone
>

-- 
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/7ec9b566-c06d-49a3-a6bb-28da652f620d%40googlegroups.com.


[tw5] Re: [Macro] Spoiler Text

2020-05-14 Thread TonyM
TonyK

You did it your own way and that's what is importiant, the diversity of 
solutions is fantastic and most importantly you demonstrate how someone can 
have an idea and make it happen. Even I with more than a decade of tiddlywiki 
experience build my own things forgetting to search how others may have.

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/59ef80fc-8eee-4269-aba3-70c6da8a4cc0%40googlegroups.com.


[tw5] Re: [Macro] Spoiler Text

2020-05-14 Thread Birthe C
Tony K,

I like that you are creating you own thing. For use with Drift it is also 
important to keep it small and fast. 

Birthe

-- 
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/5131185f-c630-487d-a38e-a6054476fd99%40googlegroups.com.


[tw5] Re: [Macro] Spoiler Text

2020-05-14 Thread Ste Wilson
No worries. Even doing a bit of research is no guarantee as sometimes you don't 
know you should be looking at that other thing over there :D 
Dave's list is always worth a search through.. 
https://dynalist.io/d/zUP-nIWu2FFoXH-oM7L7d9DM

-- 
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/8d77365d-9310-4184-bcc3-e162266d9379%40googlegroups.com.


[tw5] Re: [Macro] Spoiler Text

2020-05-14 Thread Tony K
@Brithe @TonyM @Ste Wilson

nothing new under the sun I guess :) Serves me well for not doing my 
research good enough 

Still not bad for learning though 

Cheers and thank you 

On Thursday, May 14, 2020 at 8:48:14 AM UTC+3, Tony K wrote:
>
> Building something like "flash cards" I needed to hide a text and see if 
> my kinds can remember it etc...
>
> long story short keeping on using buttons and reveal got tiresome so I did 
> a small macro I called "Spoiler text" that hides a text behind [...] and 
> can be expanded
>
> Sharing it in case it helps someone
>
> Macro 
> https://akhater.github.io/drift/#%24%3A%2Fak%2Fdrift%2Fmacros%2Fspoiler
> Example https://akhater.github.io/drift/#Example%3A%20Spoiler
>
> Also baked into Drift 
>  
>
> Nice day everyone
>

-- 
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/c11dd905-f0ff-4ad6-81c4-8e93645ab86d%40googlegroups.com.


[tw5] Re: [Macro] cross-list-links-draggable

2020-05-14 Thread Tony K
Fixed

thank you for letting me know 

On Thursday, May 14, 2020 at 11:09:58 AM UTC+3, Saq Imtiaz wrote:
>
> I don't have the exact steps to reproduce it, but dragging some items from 
> list1 to list2 and then re-ordering quite a bit in list2, I have twice 
> managed to just loose some items. They just disappear.
>
> On Thursday, May 14, 2020 at 7:44:43 AM UTC+2, Tony K wrote:
>>
>>  I needed a way to be able to drag and drop items across lists while 
>> still be able to re-order items inside the list so I modified the built 
>> in list-links-draggable macro to fit my needs
>>
>> sharing it in case any one needs it 
>>
>> Macro 
>> https://akhater.github.io/drift/#%24%3A%2Fak%2Fdrift%2Fmacros%2Fcross-list-links-draggable
>>
>> example: https://akhater.github.io/drift/#Week
>>
>> Baked in the latest version of Drift 
>> 
>>
>

-- 
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/4120b191-36cd-435e-998e-cfa9e920b6cd%40googlegroups.com.


[tw5] Re: [Macro] Spoiler Text

2020-05-14 Thread Birthe C
Thomas Elmigers Flippy cards 
 Simpler but nice CSS idea from Stephan Hradek 
http://tw5magick.tiddlyspot.com/ look for Quiz (the tw is before easy 
permalink)

Birthe

-- 
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/954ce0fd-2169-42ef-b25c-a401e7aa5f55%40googlegroups.com.


[tw5] Re: [Macro] cross-list-links-draggable

2020-05-14 Thread Saq Imtiaz
Yep I can re-create as you described below. I've done some work on 
improving some of the default drag and drop behaviour a while back. Will 
try to dig it up and post when I have time as it might be useful to improve 
other DnD solutions like yours.

On Thursday, May 14, 2020 at 10:26:27 AM UTC+2, Tony K wrote:
>
> It seems the issue happens when I reorder an item and drop it at the same 
> location in the same list
>
>  

-- 
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/9bb27770-fcad-4239-a185-a1a963f52eb8%40googlegroups.com.


[tw5] Re: [Macro] Spoiler Text

2020-05-14 Thread Ste Wilson
also http://stretchtext.tiddlyspot.com/

http://ooktech.com/jed/ExampleWikis/Flashcards/

http://tw5flashcards.tiddlyspot.com/

On Thursday, May 14, 2020 at 7:49:57 AM UTC+1, Tony K wrote:
>
> Nooo  lol :)
>
> this is so much better than what I did, and I had no idea it existed 
> although I did search 
>
> thank you
>
> On Thursday, May 14, 2020 at 9:45:53 AM UTC+3, Birthe C wrote:
>>
>> Tony K,
>>
>> Nice idea! It also reminded me of 
>> https://tid.li/tw5/hacks.html#TextStretch Did you know that one? Fun 
>> stories with telescopic texts are possible.
>>
>> Birthe
>>
>

-- 
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/7a55c047-0229-4f01-a50f-d49c881fe2eb%40googlegroups.com.


[tw5] Re: [Macro] cross-list-links-draggable

2020-05-14 Thread Tony K
weird, thank you for letting me know

[image: Annotation 2020-05-14 112541.png]
it worked for me. I odn't know what I missed but i will test it


On Thursday, May 14, 2020 at 11:09:58 AM UTC+3, Saq Imtiaz wrote:
>
> I don't have the exact steps to reproduce it, but dragging some items from 
> list1 to list2 and then re-ordering quite a bit in list2, I have twice 
> managed to just loose some items. They just disappear.
>
> On Thursday, May 14, 2020 at 7:44:43 AM UTC+2, Tony K wrote:
>>
>>  I needed a way to be able to drag and drop items across lists while 
>> still be able to re-order items inside the list so I modified the built 
>> in list-links-draggable macro to fit my needs
>>
>> sharing it in case any one needs it 
>>
>> Macro 
>> https://akhater.github.io/drift/#%24%3A%2Fak%2Fdrift%2Fmacros%2Fcross-list-links-draggable
>>
>> example: https://akhater.github.io/drift/#Week
>>
>> Baked in the latest version of Drift 
>> 
>>
>

-- 
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/bfac52dd-29ea-43f6-861f-545c05451e85%40googlegroups.com.


[tw5] Re: [Macro] Spoiler Text

2020-05-14 Thread TonyM
There have been a few flash card build on tiddlywiki one I liked had animated 
click to back of the card.

Regards
TonyM

-- 
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/273a43c5-3415-447f-b929-257575b982c9%40googlegroups.com.


[tw5] Re: [Macro] cross-list-links-draggable

2020-05-14 Thread Saq Imtiaz
I don't have the exact steps to reproduce it, but dragging some items from 
list1 to list2 and then re-ordering quite a bit in list2, I have twice 
managed to just loose some items. They just disappear.

On Thursday, May 14, 2020 at 7:44:43 AM UTC+2, Tony K wrote:
>
>  I needed a way to be able to drag and drop items across lists while still 
> be able to re-order items inside the list so I modified the built 
> in list-links-draggable macro to fit my needs
>
> sharing it in case any one needs it 
>
> Macro 
> https://akhater.github.io/drift/#%24%3A%2Fak%2Fdrift%2Fmacros%2Fcross-list-links-draggable
>
> example: https://akhater.github.io/drift/#Week
>
> Baked in the latest version of Drift 
> 
>

-- 
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/2e50d0d5-355b-449c-99df-3e81dc021366%40googlegroups.com.


[tw5] Re: [Macro] Spoiler Text

2020-05-13 Thread Tony K
Nooo  lol :)

this is so much better than what I did, and I had no idea it existed 
although I did search 

thank you

On Thursday, May 14, 2020 at 9:45:53 AM UTC+3, Birthe C wrote:
>
> Tony K,
>
> Nice idea! It also reminded me of 
> https://tid.li/tw5/hacks.html#TextStretch Did you know that one? Fun 
> stories with telescopic texts are possible.
>
> Birthe
>

-- 
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/f7979552-b406-4a16-a349-d624d595147a%40googlegroups.com.


[tw5] Re: [Macro] Spoiler Text

2020-05-13 Thread Birthe C
Tony K,

Nice idea! It also reminded me of https://tid.li/tw5/hacks.html#TextStretch 
Did you know that one? Fun stories with telescopic texts are possible.

Birthe

-- 
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/a15c417e-7f78-46e5-8532-4fe93f042d06%40googlegroups.com.


[tw5] Re: Macro not working on single word target

2020-05-08 Thread Les Barbott
That’s great, and it does help. Thx !

The only other area I am sometimes struggling with is the need to wrap 
everything when working with variables, string manipulation and list. It 
can get quite convoluted ! Is there any good ressources about that ?  I 
wish I could just set a variable by value at one point and just be done 
with the references !

-- 
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/590399cc-5f50-4276-a70e-ce6d3eca92be%40googlegroups.com.


[tw5] Re: Macro not working on single word target

2020-05-08 Thread Saq Imtiaz
Les: Basically enlist gives you a list/array of words where each member is 
one title, regardless of spaces, with no brackets.

<$list filter="[enlist{mytiddler!!mylist}]">
<$text text=<>/>


Might help with understanding as to what is going on and what the value of 
currentTiddler is for each title list member.

If you want to create links that look different etc, perhaps take a look at 
the LinkWidget.

On Friday, May 8, 2020 at 12:22:16 PM UTC+2, Les Barbott wrote:
>
>
>
> Le vendredi 8 mai 2020 11:20:13 UTC+1, Saq Imtiaz a écrit :
>>
>> <$list filter="[enlist{mytiddler!!Myfield}]"/>
>>
>> Will give you a link to each title regardless of whether it has spaces in 
>> the title or not. You can also do something different with each title 
>> inside the list widget.
>>
>
> Thank you ! 
>

-- 
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/b3518d94-ef9d-46bf-a4c7-77d0464a3cd0%40googlegroups.com.


[tw5] Re: Macro not working on single word target

2020-05-08 Thread Les Barbott


Le vendredi 8 mai 2020 11:20:13 UTC+1, Saq Imtiaz a écrit :
>
> <$list filter="[enlist{mytiddler!!Myfield}]"/>
>
> Will give you a link to each title regardless of whether it has spaces in 
> the title or not. You can also do something different with each title 
> inside the list widget.
>

Thank you ! 

-- 
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/999732da-2015-4f68-8fe7-cda75991be49%40googlegroups.com.


[tw5] Re: Macro not working on single word target

2020-05-08 Thread Saq Imtiaz
<$list filter="[enlist{mytiddler!!Myfield}]"/>

Will give you a link to each title regardless of whether it has spaces in the 
title or not. You can also do something different with each title inside the 
list widget.

-- 
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/97853eb9-386a-477b-beb6-70e131de92a1%40googlegroups.com.


[tw5] Re: Macro not working on single word target

2020-05-08 Thread Les Barbott
So I went back to studying and spent some more time looking at the Title 
List, Listops widget and filtering.

If I store the data SingleWord [[With space]] HelloThere [[Getting 
Started]] in the field myField, what would you say is the best syntax to :
1. generate a list of links (so the end goal is to have [[SingleWord]] 
[[With space]] [[HelloThere]] [[Getting Started]]) ?
2. generate a string without the [[]] ?

I only seems to find extremely convoluted solutions to this problem !

Thank you again for your help, I am really enjoying what the software 
allows so far. My only other trouble is working with string manipulation, 
variables and substitution... But that’s for another day !

Best regards, 
Paul

-- 
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/26541565-cbb7-4f70-8059-5905fe3b10b9%40googlegroups.com.


[tw5] Re: Macro not working on single word target

2020-05-08 Thread TonyM
Led

A quick followup. The list-ops term in tiddlywiki relates to manipulating 
titles so that handles the square brackets as needed.

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/dc190787-8d48-46aa-94f7-4855eb7d9906%40googlegroups.com.


[tw5] Re: Macro not working on single word target

2020-05-07 Thread Les Barbott
Thank you very much Saq ! Trying to wrap the names in bracketts before 
storing them felt like easier to then display, just view the field and 
you’re done.

Thank you very much for your quick answer ! I would never have found myself.

-- 
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/34a05675-b772-4600-ba27-2513e4a800ea%40googlegroups.com.


[tw5] Re: Macro Resolving Problem

2020-04-29 Thread TonyM
Tony

You have discovered the ease of editing one tiddler from another by using a 
transclude, and how tiddlers and fields can be silently created just by 
editing them
it is quite an elegant solution. Thanks for sharing back

I think I may extend your idea. On any tiddler we could have a Today 
Button, that the view template will transclude if selected. Thus you can 
update your Journal with a selected tiddler in view without taking any 
other actions to reach your Journal.

Regards
Tony


On Thursday, 30 April 2020 11:50:10 UTC+10, tony wrote:
>
> What a cool macro! 
>
> It's all Klingon to me, but i wrapped the modified version from Eric in a 
> logger tiddler, 
> {{logger}}
> and typed text is passed to a new journal tiddler in real time. I don't 
> even have to hit ctrl-return to 'save'.
>
> Very nice for journaling !
>
> Thank you very much,
> tony
>
> On Wednesday, April 29, 2020 at 6:24:55 PM UTC-7, Lisa Wasserman wrote:
>>
>> That did it.  Thank you very much.  I'll keep this in mind when using 
>> macros.
>>
>> --Lisa
>>
>

-- 
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/ca88b79c-db78-48fd-9a3a-415f7635c1a5%40googlegroups.com.


[tw5] Re: Macro Resolving Problem

2020-04-29 Thread tony
What a cool macro! 

It's all Klingon to me, but i wrapped the modified version from Eric in a 
logger tiddler, 
{{logger}}
and typed text is passed to a new journal tiddler in real time. I don't 
even have to hit ctrl-return to 'save'.

Very nice for journaling !

Thank you very much,
tony

On Wednesday, April 29, 2020 at 6:24:55 PM UTC-7, Lisa Wasserman wrote:
>
> That did it.  Thank you very much.  I'll keep this in mind when using 
> macros.
>
> --Lisa
>

-- 
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/b5980eed-3f36-4684-9cb6-c0c42515771b%40googlegroups.com.


[tw5] Re: Macro Resolving Problem

2020-04-29 Thread Lisa Wasserman
That did it.  Thank you very much.  I'll keep this in mind when using 
macros.

--Lisa

-- 
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/4fac39b7-e6ef-4df8-9d54-63540c90ba8a%40googlegroups.com.


[tw5] Re: Macro Resolving Problem

2020-04-29 Thread TonyM
Further to my last post;

When setting a variable using $set or $vars you may also be using a macro 
to set a value, 
eg
<$vars when=<> >

Once again this macro can only be used as a parameter if we;

   - Use substitutions in its definition
   - OR be defined using javascript, as the NOW macro is.

Please confirm this as well.

Regards
Tony

On Thursday, April 30, 2020 at 10:11:05 AM UTC+10, TonyM wrote:
>
> Eric,
>
> Genius. For the first time you have explicitly stated why I have 
> experienced repeated "fragility" when designing solutions in TiddlyWiki. 
>
> Please confirm or correct my interpretation below;
>
> Macros are text-substitution processors.  As such, they only do two things:
>>
>> 1) replace parameters -- $paramname$ -- with the values passed to the 
>> macro
>> 2) replace variables -- $(variablename)$ -- with the values currently 
>> assigned by the calling context
>>
>> After completing those replacements, the result is then inserted into the 
>> calling context which determines how the macro result is handled. 
>>
>  
> ...
> With this example
>
>> \define journalTiddlerName( ) <> $(project)$
>>
>
> 1) <$transclude tiddler=<> mode="block" />
>> 2) <>
>> 3) <$tiddler tiddler=<>>
>>
>
>
> *I think an easy to make error, is that <> renders as 
> expected in wikitext (2nd example above), but if it contains "anything" 
> other than substitutions (macros or widgets) it will not work as a 
> parameter (as used in 1 & 3).*
>
> *Can we also say?*
>
>- If it must be used as a parameter, it should first be wikified?
>- Wikification with the wikify widget needs to be done on a whole 
>macro, you can't rely on the wikify widget inside a macro definition, 
>because this will not work in a parameter because of the wikify widget 
>itself.
>- This means that the wikify widget is of limited use inside macros 
>which you may wish to use as a parameter.
>
> Please confirm or clarify this an I will publish this lesson in my own 
> words for the larger community.
>
> Thanks in advance
> 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/b62751b2-527c-43d2-8c5f-70e5c04ca9e9%40googlegroups.com.


[tw5] Re: Macro Resolving Problem

2020-04-29 Thread TonyM
Eric,

Genius. For the first time you have explicitly stated why I have 
experienced repeated "fragility" when designing solutions in TiddlyWiki. 

Please confirm or correct my interpretation below;

Macros are text-substitution processors.  As such, they only do two things:
>
> 1) replace parameters -- $paramname$ -- with the values passed to the macro
> 2) replace variables -- $(variablename)$ -- with the values currently 
> assigned by the calling context
>
> After completing those replacements, the result is then inserted into the 
> calling context which determines how the macro result is handled. 
>
 
...
With this example

> \define journalTiddlerName( ) <> $(project)$
>

1) <$transclude tiddler=<> mode="block" />
> 2) <>
> 3) <$tiddler tiddler=<>>
>


*I think an easy to make error, is that <> renders as 
expected in wikitext (2nd example above), but if it contains "anything" 
other than substitutions (macros or widgets) it will not work as a 
parameter (as used in 1 & 3).*

*Can we also say?*

   - If it must be used as a parameter, it should first be wikified?
   - Wikification with the wikify widget needs to be done on a whole macro, 
   you can't rely on the wikify widget inside a macro definition, because this 
   will not work in a parameter because of the wikify widget itself.
   - This means that the wikify widget is of limited use inside macros 
   which you may wish to use as a parameter.

Please confirm or clarify this an I will publish this lesson in my own 
words for the larger community.

Thanks in advance
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/f47cc701-6657-4dff-92f2-75c2266e2e71%40googlegroups.com.


[tw5] Re: Macro Resolving Problem

2020-04-29 Thread Eric Shulman
On Wednesday, April 29, 2020 at 1:42:49 PM UTC-7, Lisa Wasserman wrote:
>
> \define journalTiddlerName( ) <> $(project)$
>

Macros are text-substitution processors.  As such, they only do two things:

1) replace parameters -- $paramname$ -- with the values passed to the macro
2) replace variables -- $(variablename)$ -- with the values currently 
assigned by the calling context

After completing those replacements, the result is then inserted into the 
calling context which determines how the macro result is handled.

In your code, you have three instances of the <> macro:

1) <$transclude tiddler=<> mode="block" />
2) <>
3) <$tiddler tiddler=<>>

In both the 1st and 3rd instances, the macro output is used as the value 
for the "tiddler" parameter in a widget call and the macro output is simply 
passed along to the widget for further handling.
In the 2nd instance, the macro output is actually being *displayed* and it 
is directly parsed and rendered.

For your purposes, you want to actually evaluate the <> macro and 
then substitute it's output into the macro.

Here's a modified version of your code that should do what you want:
\define journalTiddlerName( ) $(when)$ $(project)$
\define state() $:/state/$(currentTiddler)$
<$vars project={{!!project}} when=<>>
   <$reveal type="nomatch" state=<> text="show">
  Today <$button set=<> setTo="show" class=
"tc-btn-invisible">{{$:/core/images/edit-button}}
  <$transclude tiddler=<> mode="block" />
   
   <$reveal type="match" state=<> text="show">
  Today <$button set=<> setTo="hide" 
class="tc-btn-invisible">{{$:/core/images/done-button}}
  <>
  <$tiddler tiddler=<>>{{||$:/core/ui/
EditTemplate/body/editor}}
   


notes:
* I used the <$vars> widget instead of separate <$set> widgets.  It does 
the same thing as $set (assigns values to variables), but is a more compact 
syntax.
* I omitted the setting of the state variable, since it was just setting 
the value to itself.  
* I added a variable, "when" which captures the output of the <> 
macro.
* The "journalTiddlerName" macro then uses the $(when)$ reference to 
substitute the captured "now" value into the desired result.

Give it a try and let me know how it goes...

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki - http://TiddlyTools.com/InsideTW





  <$transclude tiddler=<> mode="block" />
>
><$reveal type="match" state=<> text="show">
>   
> Today
> <$button set=<> setTo="hide" 
> class="tc-btn-invisible">{{$:/core/images/done-button}}
>   
> <>
> <$tiddler tiddler=<>>
> {{||$:/core/ui/EditTemplate/body/editor}}
>   
>
> 
> 
>
> There are three calls to <>.  The first and third 
> return "<> WR-38972", while the second returns "
> 29-April-2020 WR-38972".  For some reason, the Now macro is only working 
> part of the time.  Thoughts?
>

-- 
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/6c12adb2-fd8a-4c13-8e90-10657adfdcc6%40googlegroups.com.


[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.


[tw5] Re: [macro] presenting new icon macro (for icons in text)

2020-03-11 Thread Diego Mesa
Also try to get this into the core!  

On Wednesday, March 11, 2020 at 10:22:29 AM UTC-5, Mohammad wrote:
>
> Hi HC Hasse,
>  Thank you for sharing. Nice stuffs. I also sue a macro doc-svg in Utility 
> plugin just to set the size and vertical alignment.
> Strangely there is no documentation macro for this in tiddlywiki.com.
>
> Your macro not only set he size and alignment but also create a link and 
> acts as button. You may add a css class input parameter to set the 
> color/fill, 
>
> Good luck
> --Mohammad
>
> On Wednesday, March 11, 2020 at 2:02:00 PM UTC+3:30, HC Haase wrote:
>>
>> First off. This is not mine. I found it by chance, on Bimlas' page. so 
>> credit to him.
>>
>>
>> I have made some documentation and added an extended version.
>>
>> demo/download: https://hchaase.github.io/HC-Plugins/#macro%2Ficon
>>
>>
>>- *Version*: 1.0.0
>>- *Date*: 2020/02/27
>>- *Creator*: HC Haase. Inspired by Bimlas 
>>
>>.
>>
>> Function
>>
>> This macro make transcluded icons follow the line height of the text with 
>> the option of a link and a tooltip. This makes prettier references to 
>> buttons (instead of this ) in documentation text.
>>
>> There is a* simple macro* without a button and an *extended macro* with 
>> a button.
>> UseSyntax, simple macro (note the _)<<_icon  >>Syntax, 
>> extended macro<  "" >>
>> Example<>
>>
>

-- 
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/6c4b7553-2783-42de-86a2-b712d6f2bbd7%40googlegroups.com.


[tw5] Re: [macro] presenting new icon macro (for icons in text)

2020-03-11 Thread Mohammad
Hi HC Hasse,
 Thank you for sharing. Nice stuffs. I also sue a macro doc-svg in Utility 
plugin just to set the size and vertical alignment.
Strangely there is no documentation macro for this in tiddlywiki.com.

Your macro not only set he size and alignment but also create a link and 
acts as button. You may add a css class input parameter to set the 
color/fill, 

Good luck
--Mohammad

On Wednesday, March 11, 2020 at 2:02:00 PM UTC+3:30, HC Haase wrote:
>
> First off. This is not mine. I found it by chance, on Bimlas' page. so 
> credit to him.
>
>
> I have made some documentation and added an extended version.
>
> demo/download: https://hchaase.github.io/HC-Plugins/#macro%2Ficon
>
>
>- *Version*: 1.0.0
>- *Date*: 2020/02/27
>- *Creator*: HC Haase. Inspired by Bimlas 
>
>.
>
> Function
>
> This macro make transcluded icons follow the line height of the text with 
> the option of a link and a tooltip. This makes prettier references to 
> buttons (instead of this ) in documentation text.
>
> There is a* simple macro* without a button and an *extended macro* with a 
> button.
> UseSyntax, simple macro (note the _)<<_icon  >>Syntax, 
> extended macro<  "" >>
> Example<>
>

-- 
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/ea3aadee-4dd9-42e7-b307-cda0ef8bd0ed%40googlegroups.com.


[tw5] Re: Macro shows conditional contents interactively

2019-09-19 Thread Mohammad
Thanks!

Added to TW-Scripts

On Thursday, September 19, 2019 at 12:26:27 PM UTC+4:30, PMario wrote:
>
> On Thursday, September 19, 2019 at 9:49:38 AM UTC+2, Mohammad wrote:
>>
>> Okay Mario!
>>  So if we use $:/state/popup/ prefixed state tiddlers then there is no 
>> need for startup action here right?
>>
>
> I didn't test it, but I think it should work, if you reload the page or 
> click "home" button.
>
> -m 
>

-- 
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/9a7ad9d1-83a4-433d-90f3-9578442cc14f%40googlegroups.com.


  1   2   >