[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] Inconsistency drives me nuts

2023-02-05 Thread Charlie Veniot
Strangely, I often find myself doing things differently from day to day.  
Maybe mood-related, maybe because I do like to try things differently to 
test or firm up my understanding.

When I use something, though, in order to help me sort things out (i.e. 
getting intertwingularity to submit to my will !), I desperately need 
consistency.

Hence my slow and sporadic attempt to create TiddlyWiki documentation that 
works for me (https://groups.google.com/g/tiddlywiki/c/cwCkCaiJG_g)

For example of an annoyance, the WidgetMessage: tm-modal 
 documentation tiddler.

The top part of the documentation, in the table, defines one of the 
message's parameters as "*param*".

But in the examples, it is clear that the parameter is actually "*$param*" 
when the message is used with the $action-message widget..

And then, $param is for the title of a tiddler.

But in other widgets, "tiddler" is the parameter for the title of a tiddler.

And when we look at the parameters for various widgets, sometimes we have 
parameters with $ prefixes, other times we don't.

Inconsistency is confusing.

And creating documentation that works for me is slowed down because to get 
the documentation "right", I find myself having to wrap some of the widgets 
with macros, and suggesting the use of the macros instead of direct use of 
the widgets.

Messy.


-- 
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/675007a9-0f83-4dc5-a5d7-cbbb98417003n%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.


[tw5] Macro

2023-02-05 Thread vinvi...@gmail.com
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/5c25cecd-08e1-48ea-9e1a-9332bea5b08an%40googlegroups.com.