[tw5] Re: Using <$list> widget to generate table rows

2021-08-12 Thread springer
Louis, responding not directly to your question, but to the kind of task 
that seems to lie behind it:

if you're trying to display tables with rows that meet filter conditions, 
you might be well served by Mohammad's Shiraz plugin 
, which offers dynamic tables with 
many lovely features. 

If you stand on Mohammad's shoulders, your tiddlywiki time is freed up to 
solve more nuanced problems!

-Springer



On Monday, August 9, 2021 at 9:46:15 AM UTC-4 davou...@gmail.com wrote:

>
> I'm trying to use the <$list> widget generate table rows. One is this even 
> possible. Two How? Here is simplified version of code I've tried. 
>
> \define davout-list(levels: "1,3,5")
> | ! Level | ! Blah |
> <$list filter="[[$levels$]split[,]]" variable="level">
> | <> | Blah |
> 
> \end
>
> \define davout-list2(levels: "1,3,5")
> | ! Level | ! Blah |
> <$list filter="[[$levels$]split[,]]" variable="level">
> | <> | Blah |
> <$wikify name=wikifiedRow text=| <> | Blah |>
> <>
> 
> 
> \end
>
> <>
>
> <>
>
> The html it generates:
>  Level align="center"> Blah
> | 1 | Blah |
>
> | 3 | Blah |
>
> | 5 | Blah |
>  Level align="center"> Blah
> | 1 | Blah |
>  | Blah |
> |
>
>
> | 3 | Blah |
>  | Blah |
> |
>
>
> | 5 | Blah |
>  | Blah |
> |
>
> 
>
> It's closing the table and generating  tags.
> -
> A more general question. It's been stated that macros are text 
> substitution not functions that return a value. And they don't "evaluate". 
> I've seen first hand they don't return a value, but they do seem to at 
> least execute some code. For example they do call other macros:
>
> \define a()
> <>
> \end
>
> \define b(where)
> $where$
> \end
>
> <>
>
> produces:
> here
>
> So what are the rules for what macros will and will not "execute"?
>
> Thanks.
>

-- 
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/4a5e1dbc-91dd-4767-9cd1-b21a9c43bf19n%40googlegroups.com.


Re: [tw5] Re: Using <$list> widget to generate table rows

2021-08-12 Thread Jeremy Ruston
Hi Louis

As you've discovered, the wikitext table syntax is very simple, and doesn't 
support dynamic generation. The philosophy of TiddlyWiki's wikitext syntax is 
to provide easy-to-type shortcuts for common idioms that expand to sequences of 
widgets. In designing the wikitext syntax we are able to favour simplicity over 
flexibility because it is always possible for users to drop down into "raw 
widgets" to get the finest possible degree of control.

One can visualise the various elements of wikitext as a hierarchy of 
complexity/flexibility:

* Wikitext syntax is simple, easy to type and remember
* Macros add dynamic effects with the simplest possible syntax (because there 
are no closing tags to get mismatched)
* Widgets (and HTML) provide the base level of elementary primitives

Best wishes

Jeremy.

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

> On 9 Aug 2021, at 22:02, Louis Davout  wrote:
> 
> 
> Well this works:
> 
> \define davout-list(levels: "1,3,5")
> 
> LevelBlah
> <$list filter="[[$levels$]split[,]]" variable="level">
> <> Blah
> 
> 
> \end
>> On Monday, August 9, 2021 at 9:53:34 AM UTC-4 Louis Davout wrote:
>> \define davout-list(levels: "1,3,5")
>> | ! Level | ! Blah |
>> <$list filter="[[$levels$]split[,]]" variable="level">
>> 
>> | <> | Blah |
>> 
>> 
>> \end 
>> 
>> Removes the  tags but makes each row into its own table.
>> 
>>> On Monday, August 9, 2021 at 9:46:15 AM UTC-4 Louis Davout wrote:
>>> 
>>> I'm trying to use the <$list> widget generate table rows. One is this even 
>>> possible. Two How? Here is simplified version of code I've tried. 
>>> 
>>> \define davout-list(levels: "1,3,5")
>>> | ! Level | ! Blah |
>>> <$list filter="[[$levels$]split[,]]" variable="level">
>>> | <> | Blah |
>>> 
>>> \end
>>> 
>>> \define davout-list2(levels: "1,3,5")
>>> | ! Level | ! Blah |
>>> <$list filter="[[$levels$]split[,]]" variable="level">
>>> | <> | Blah |
>>> <$wikify name=wikifiedRow text=| <> | Blah |>
>>> <>
>>> 
>>> 
>>> \end
>>> 
>>> <>
>>> 
>>> <>
>>> 
>>> The html it generates:
>>>  Level>> align="center"> Blah
>>> | 1 | Blah |
>>> 
>>> | 3 | Blah |
>>> 
>>> | 5 | Blah |
>>>  Level>> align="center"> Blah
>>> | 1 | Blah |
>>>  | Blah |
>>> |
>>> 
>>> 
>>> | 3 | Blah |
>>>  | Blah |
>>> |
>>> 
>>> 
>>> | 5 | Blah |
>>>  | Blah |
>>> |
>>> 
>>> 
>>> 
>>> It's closing the table and generating  tags.
>>> -
>>> A more general question. It's been stated that macros are text substitution 
>>> not functions that return a value. And they don't "evaluate". I've seen 
>>> first hand they don't return a value, but they do seem to at least execute 
>>> some code. For example they do call other macros:
>>> 
>>> \define a()
>>> <>
>>> \end
>>> 
>>> \define b(where)
>>> $where$
>>> \end
>>> 
>>> <>
>>> 
>>> produces:
>>> here
>>> 
>>> So what are the rules for what macros will and will not "execute"?
>>> 
>>> Thanks.
> 
> -- 
> 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/c17202a8-3ee6-47b5-a9e1-d5f4b2f04563n%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/759AAEBB-8EAA-4D62-9355-254F9336013C%40gmail.com.


[tw5] Re: Using <$list> widget to generate table rows

2021-08-12 Thread TW Tones
I see you were talking to yourself, 

Are you fine now?

Personally I prefer using the html table tags especially when I use a list 
inside the table to generate rows and another for columns.

Regards
Tones

On Tuesday, 10 August 2021 at 07:02:44 UTC+10 davou...@gmail.com wrote:

> Well this works:
>
> \define davout-list(levels: "1,3,5")
> 
> LevelBlah
> <$list filter="[[$levels$]split[,]]" variable="level">
> <> Blah
> 
> 
> \end
> On Monday, August 9, 2021 at 9:53:34 AM UTC-4 Louis Davout wrote:
>
>> \define davout-list(levels: "1,3,5")
>> | ! Level | ! Blah |
>> <$list filter="[[$levels$]split[,]]" variable="level">
>>
>> | <> | Blah |
>>
>> 
>> \end 
>>
>> Removes the  tags but makes each row into its own table.
>>
>> On Monday, August 9, 2021 at 9:46:15 AM UTC-4 Louis Davout wrote:
>>
>>>
>>> I'm trying to use the <$list> widget generate table rows. One is this 
>>> even possible. Two How? Here is simplified version of code I've tried. 
>>>
>>> \define davout-list(levels: "1,3,5")
>>> | ! Level | ! Blah |
>>> <$list filter="[[$levels$]split[,]]" variable="level">
>>> | <> | Blah |
>>> 
>>> \end
>>>
>>> \define davout-list2(levels: "1,3,5")
>>> | ! Level | ! Blah |
>>> <$list filter="[[$levels$]split[,]]" variable="level">
>>> | <> | Blah |
>>> <$wikify name=wikifiedRow text=| <> | Blah |>
>>> <>
>>> 
>>> 
>>> \end
>>>
>>> <>
>>>
>>> <>
>>>
>>> The html it generates:
>>>  Level>> align="center"> Blah
>>> | 1 | Blah |
>>>
>>> | 3 | Blah |
>>>
>>> | 5 | Blah |
>>>  Level>> align="center"> Blah
>>> | 1 | Blah |
>>>  | Blah |
>>> |
>>>
>>>
>>> | 3 | Blah |
>>>  | Blah |
>>> |
>>>
>>>
>>> | 5 | Blah |
>>>  | Blah |
>>> |
>>>
>>> 
>>>
>>> It's closing the table and generating  tags.
>>> -
>>> A more general question. It's been stated that macros are text 
>>> substitution not functions that return a value. And they don't "evaluate". 
>>> I've seen first hand they don't return a value, but they do seem to at 
>>> least execute some code. For example they do call other macros:
>>>
>>> \define a()
>>> <>
>>> \end
>>>
>>> \define b(where)
>>> $where$
>>> \end
>>>
>>> <>
>>>
>>> produces:
>>> here
>>>
>>> So what are the rules for what macros will and will not "execute"?
>>>
>>> Thanks.
>>>
>>

-- 
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/13092a1e-1cf0-4477-9119-12345cdce2d6n%40googlegroups.com.


[tw5] Re: Using <$list> widget to generate table rows

2021-08-09 Thread Louis Davout
Well this works:

\define davout-list(levels: "1,3,5")

LevelBlah
<$list filter="[[$levels$]split[,]]" variable="level">
<> Blah


\end
On Monday, August 9, 2021 at 9:53:34 AM UTC-4 Louis Davout wrote:

> \define davout-list(levels: "1,3,5")
> | ! Level | ! Blah |
> <$list filter="[[$levels$]split[,]]" variable="level">
>
> | <> | Blah |
>
> 
> \end 
>
> Removes the  tags but makes each row into its own table.
>
> On Monday, August 9, 2021 at 9:46:15 AM UTC-4 Louis Davout wrote:
>
>>
>> I'm trying to use the <$list> widget generate table rows. One is this 
>> even possible. Two How? Here is simplified version of code I've tried. 
>>
>> \define davout-list(levels: "1,3,5")
>> | ! Level | ! Blah |
>> <$list filter="[[$levels$]split[,]]" variable="level">
>> | <> | Blah |
>> 
>> \end
>>
>> \define davout-list2(levels: "1,3,5")
>> | ! Level | ! Blah |
>> <$list filter="[[$levels$]split[,]]" variable="level">
>> | <> | Blah |
>> <$wikify name=wikifiedRow text=| <> | Blah |>
>> <>
>> 
>> 
>> \end
>>
>> <>
>>
>> <>
>>
>> The html it generates:
>>  Level> align="center"> Blah
>> | 1 | Blah |
>>
>> | 3 | Blah |
>>
>> | 5 | Blah |
>>  Level> align="center"> Blah
>> | 1 | Blah |
>>  | Blah |
>> |
>>
>>
>> | 3 | Blah |
>>  | Blah |
>> |
>>
>>
>> | 5 | Blah |
>>  | Blah |
>> |
>>
>> 
>>
>> It's closing the table and generating  tags.
>> -
>> A more general question. It's been stated that macros are text 
>> substitution not functions that return a value. And they don't "evaluate". 
>> I've seen first hand they don't return a value, but they do seem to at 
>> least execute some code. For example they do call other macros:
>>
>> \define a()
>> <>
>> \end
>>
>> \define b(where)
>> $where$
>> \end
>>
>> <>
>>
>> produces:
>> here
>>
>> So what are the rules for what macros will and will not "execute"?
>>
>> Thanks.
>>
>

-- 
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/c17202a8-3ee6-47b5-a9e1-d5f4b2f04563n%40googlegroups.com.


[tw5] Re: Using <$list> widget to generate table rows

2021-08-09 Thread Louis Davout
 \define davout-list(levels: "1,3,5")
| ! Level | ! Blah |
<$list filter="[[$levels$]split[,]]" variable="level">

| <> | Blah |


\end 

Removes the  tags but makes each row into its own table.

On Monday, August 9, 2021 at 9:46:15 AM UTC-4 Louis Davout wrote:

>
> I'm trying to use the <$list> widget generate table rows. One is this even 
> possible. Two How? Here is simplified version of code I've tried. 
>
> \define davout-list(levels: "1,3,5")
> | ! Level | ! Blah |
> <$list filter="[[$levels$]split[,]]" variable="level">
> | <> | Blah |
> 
> \end
>
> \define davout-list2(levels: "1,3,5")
> | ! Level | ! Blah |
> <$list filter="[[$levels$]split[,]]" variable="level">
> | <> | Blah |
> <$wikify name=wikifiedRow text=| <> | Blah |>
> <>
> 
> 
> \end
>
> <>
>
> <>
>
> The html it generates:
>  Level align="center"> Blah
> | 1 | Blah |
>
> | 3 | Blah |
>
> | 5 | Blah |
>  Level align="center"> Blah
> | 1 | Blah |
>  | Blah |
> |
>
>
> | 3 | Blah |
>  | Blah |
> |
>
>
> | 5 | Blah |
>  | Blah |
> |
>
> 
>
> It's closing the table and generating  tags.
> -
> A more general question. It's been stated that macros are text 
> substitution not functions that return a value. And they don't "evaluate". 
> I've seen first hand they don't return a value, but they do seem to at 
> least execute some code. For example they do call other macros:
>
> \define a()
> <>
> \end
>
> \define b(where)
> $where$
> \end
>
> <>
>
> produces:
> here
>
> So what are the rules for what macros will and will not "execute"?
>
> Thanks.
>

-- 
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/c9984423-1291-43d6-80e7-d5c977ecf4d9n%40googlegroups.com.