[tw5] Re: Using Filter Notation in code for Table of Contents

2023-04-25 Thread springer
Many apologies for posting before trying more things! 

(I had quickly tried some variant ways, but somehow tried all kinds of 
variants other than filter notation *with* quote-marks. I won't bore you 
further with explaining why I got confused. Thanks for the prompt 
clarification!)

-Springer

On Tuesday, April 25, 2023 at 2:28:40 PM UTC-4 PMario wrote:

> Please have a look at the docs. [[title with spaces]]
>
> [image: toc-exclude-param.png]
>
> -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/6c6432d9-3e1d-48cf-a3dc-a77c91d31d91n%40googlegroups.com.


[tw5] Re: Using Filter Notation in code for Table of Contents

2023-04-25 Thread PMario
Please have a look at the docs. [[title with spaces]]

[image: toc-exclude-param.png]

-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/674a1a4e-4c49-425a-ba6f-3258c90e2dcen%40googlegroups.com.


[tw5] Re: Using Filter Notation in code for Table of Contents

2023-04-25 Thread Eric Shulman
On Tuesday, April 25, 2023 at 8:40:38 AM UTC-7 springer wrote:

```
<$macrocall
$name="toc-tabbed-external-nav"
tag="Common Operators"
exclude="all Operator"
/>
```
As best I can tell, it fails when BOTH the tag and the exclude string have 
spaces.


Before the TOC code change, the `excluded` variable contained a ***list of 
tiddlers titles*** that had already been "visited" and was applied 
internally using `-[enlist]` to prevent infinite "loops" in the 
tree.  In v5.3.0-prerelease, this variable can now also use filter syntax 
to generate a list of tiddler titles to be excluded (applied internally 
using `-[subfilter]`).  The TOC code changes also now permit this 
parameter to be passed in to `toc-tabbed-external-nav`.  Since the value 
has always operated on a LIST, the correct usage to pass a specified title 
containing a space would be `exclude="[[all Operator]]"`

Note also that the `tag` parameter (used to specify the starting "root tag" 
for the tree) is NOT a list, and CAN contain spaces, since it is used 
internally via `tag<__tag__>`.

This DOES work as before:
```
<$macrocall
$name="toc-tabbed-external-nav"
tag="Common Operators"
exclude="[[all Operator]]"
/>
```

-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/2fb0dadb-020f-4f2a-962f-44c99d8ea8cbn%40googlegroups.com.


[tw5] Re: Using Filter Notation in code for Table of Contents

2023-04-25 Thread springer
On the demo site, this kind of simple thing now works:

```
<$macrocall
$name="toc-tabbed-external-nav"
tag="TableOfContents"
exclude="HelloThere"
/>
```
But this does not work:
```
<$macrocall
$name="toc-tabbed-external-nav"
tag="Common Operators"
exclude="all Operator"
/>
```
As best I can tell, it fails when BOTH the tag and the exclude string have 
spaces.

This seems to be have been true (all along) for the 
toc-selective-expandable as well (which I never use, except now in testing).

Of course, I could make a workaround described earlier in this thread --  
setting a variable called excluded so that `exclude=<>` could do 
the work in the toc macro. 

But it seems the exclude parameter is of very limited use if it can't be 
used on the fly (without framing a variable beforehand) for something as 
simple as excluding a tiddler that has spaces in the title, when the tag 
title also has spaces in it.

Am I missing something?

-Springer
On Tuesday, April 25, 2023 at 7:47:50 AM UTC-4 PMario wrote:

> On Saturday, February 11, 2023 at 3:24:47 AM UTC+1 Eric Shulman wrote:
>
> I've submitted a `[BUG]` issue on GitHub: 
> https://github.com/Jermolene/TiddlyWiki5/issues/7261
>
>
> Hi folks, 
> There is a preview version 
> https://tiddlywiki5-4elmgaims-jermolene.vercel.app/
> created by the PR https://github.com/Jermolene/TiddlyWiki5/pull/7417 ... 
> which may be included into the next TW version. 
>  
> docs: 
> https://tiddlywiki5-4elmgaims-jermolene.vercel.app/#Table-of-Contents%20Macros
>
> Please test and give feedback. 
> have fun!
> 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/929c50be-4192-4443-9cf4-db9a232e6980n%40googlegroups.com.


[tw5] Re: Using Filter Notation in code for Table of Contents

2023-04-25 Thread PMario
On Saturday, February 11, 2023 at 3:24:47 AM UTC+1 Eric Shulman wrote:

I've submitted a `[BUG]` issue on GitHub: 
https://github.com/Jermolene/TiddlyWiki5/issues/7261


Hi folks, 
There is a preview version 
https://tiddlywiki5-4elmgaims-jermolene.vercel.app/
created by the PR https://github.com/Jermolene/TiddlyWiki5/pull/7417 ... 
which may be included into the next TW version. 
 
docs: 
https://tiddlywiki5-4elmgaims-jermolene.vercel.app/#Table-of-Contents%20Macros

Please test and give feedback. 
have fun!
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/53037a10-7135-499b-b2c9-8001b59c4049n%40googlegroups.com.


[tw5] Re: Using Filter Notation in code for Table of Contents

2023-02-10 Thread Eric Shulman
I've submitted a `[BUG]` issue on GitHub: 
https://github.com/Jermolene/TiddlyWiki5/issues/7261

The writeup for this issue includes some minor code changes to 
`$:/core/macros/toc` that will enable support for the use of the `exclude` 
parameter with `toc-tabbed-internal-nav` and `toc-tabbed-external-nav`.

Attached is a JSON file containing the modified `$:/core/macros/toc`, which 
I have tested on https://TiddlyWiki.com
On Friday, February 10, 2023 at 4:15:39 PM UTC-8 springer wrote:

> So, it turns out this solution does NOT work for toc-tabbed-internal-nav 
> and toc-tabbed-external-nav
>
> Adding this point here (in addition to at talk.tiddlywiki.org) because 
> this thread is newer, AND someone hitting their head against the wall 
> wondering why it's not working might feel a bit more sane if the issue is 
> flagged.
>
> Eric, if you happen to have a workaround ;) ...
> On Thursday, January 26, 2023 at 7:34:38 PM UTC-5 Eric Shulman wrote:
>
>> For the first problem (excluding items tagged with "Todo"), try this:
>> ```
>> <$set name="todo" filter="[tag[Todo]]">
>> 
>> <$macrocall $name="toc-selective-expandable" tag="ML" 
>> sort="sort[created]" exclude=<> />
>> 
>> 
>> ```
>> Notes:
>> * The `$set` widget gets the list of all tiddlers tagged with "Todo" and 
>> stores it in the "exclude" variable
>> * `` applies the TWCore pre-defined 
>> styles to suppress the "numbered bullet item" display
>> * Using the `$macrocall` widget instead of the 
>> `<>` macro syntax allows you to pass the 
>> value of the "exclude" variable as a parameter
>>
>> To fix the second problem (where the root tag contains an apostrophe), 
>> enclose the root tag in double quotes:
>> ```
>> <>
>> ```
>> * The `$macrocall` syntax will also handle the second problem , since all 
>> the parameter values are already enclosed in double quotes.
>>
>> Let me know how it goes...
>>
>> enjoy,
>> -e
>> On Thursday, January 26, 2023 at 3:32:33 PM UTC-8 jaroslawb...@gmail.com 
>> wrote:
>>
>>> Hello! I am new user of TiddlyWiki, I work on Windows, Google Chrome and 
>>> have a problem when creating Table of Contents. 
>>>
>>> The following code works for me:
>>>
>>> <>
>>>
>>> I obtain list of tiddlers tagged *ML*, which is sorted by creation 
>>> date. Amazing!
>>>
>>> But...  2 things:
>>>
>>> 1) I want to be able to customize this list e.g. ''tiddlers with tag 
>>> *ML*, but without tag *Todo*'' etc. So filter notation would be awesome
>>> 2) I run into a problem when name of tag tiddler has apostrophe e.g. 
>>> *Cauchy's 
>>> Integral, *then I am unable to create list of this tag using standard 
>>> Table of Contents notation (hence again need of filter notation)
>>>
>>> So what also works for me is that:
>>>
>>> <>
>>>
>>> but I don't seem to be able to do *anything else* to that. What code 
>>> lines* do not work* for me:
>>>
>>>
>>>- <>
>>>- <>
>>>- <>
>>>- <>
>>>- <>
>>>
>>> All of the above commands don't produce a thing and I really wish they 
>>> worked.
>>>
>>> I would be really really thankful for help, because I love TiddlyWiki. 
>>> And also I'm sorry if that's stupid thing to ask or wrong place to post 
>>> such quesion - I am absolute begginer. If that's the case please tell me 
>>> what should I do instead. 
>>>
>>> Have a great day!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>

-- 
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/0ee80623-a729-4c42-9f45-2ba564968a1fn%40googlegroups.com.


$__core_macros_toc.json
Description: application/json


[tw5] Re: Using Filter Notation in code for Table of Contents

2023-02-10 Thread springer
So, it turns out this solution does NOT work for toc-tabbed-internal-nav 
and toc-tabbed-external-nav

Adding this point here (in addition to at talk.tiddlywiki.org) because this 
thread is newer, AND someone hitting their head against the wall wondering 
why it's not working might feel a bit more sane if the issue is flagged.

Eric, if you happen to have a workaround ;) ...
On Thursday, January 26, 2023 at 7:34:38 PM UTC-5 Eric Shulman wrote:

> For the first problem (excluding items tagged with "Todo"), try this:
> ```
> <$set name="todo" filter="[tag[Todo]]">
> 
> <$macrocall $name="toc-selective-expandable" tag="ML" sort="sort[created]" 
> exclude=<> />
> 
> 
> ```
> Notes:
> * The `$set` widget gets the list of all tiddlers tagged with "Todo" and 
> stores it in the "exclude" variable
> * `` applies the TWCore pre-defined 
> styles to suppress the "numbered bullet item" display
> * Using the `$macrocall` widget instead of the 
> `<>` macro syntax allows you to pass the 
> value of the "exclude" variable as a parameter
>
> To fix the second problem (where the root tag contains an apostrophe), 
> enclose the root tag in double quotes:
> ```
> <>
> ```
> * The `$macrocall` syntax will also handle the second problem , since all 
> the parameter values are already enclosed in double quotes.
>
> Let me know how it goes...
>
> enjoy,
> -e
> On Thursday, January 26, 2023 at 3:32:33 PM UTC-8 jaroslawb...@gmail.com 
> wrote:
>
>> Hello! I am new user of TiddlyWiki, I work on Windows, Google Chrome and 
>> have a problem when creating Table of Contents. 
>>
>> The following code works for me:
>>
>> <>
>>
>> I obtain list of tiddlers tagged *ML*, which is sorted by creation date. 
>> Amazing!
>>
>> But...  2 things:
>>
>> 1) I want to be able to customize this list e.g. ''tiddlers with tag *ML*, 
>> but without tag *Todo*'' etc. So filter notation would be awesome
>> 2) I run into a problem when name of tag tiddler has apostrophe e.g. 
>> *Cauchy's 
>> Integral, *then I am unable to create list of this tag using standard 
>> Table of Contents notation (hence again need of filter notation)
>>
>> So what also works for me is that:
>>
>> <>
>>
>> but I don't seem to be able to do *anything else* to that. What code 
>> lines* do not work* for me:
>>
>>
>>- <>
>>- <>
>>- <>
>>- <>
>>- <>
>>
>> All of the above commands don't produce a thing and I really wish they 
>> worked.
>>
>> I would be really really thankful for help, because I love TiddlyWiki. 
>> And also I'm sorry if that's stupid thing to ask or wrong place to post 
>> such quesion - I am absolute begginer. If that's the case please tell me 
>> what should I do instead. 
>>
>> Have a great day!
>>
>>
>>
>>
>>
>>
>>
>>

-- 
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/f974630a-63be-4cae-8a1b-0c4d65a73dc2n%40googlegroups.com.


[tw5] Re: Using Filter Notation in code for Table of Contents

2023-01-26 Thread Jarosław Szyc
Ww!!! 

Everything you described worked like a charm! ^^

thank you very much!



On Friday, January 27, 2023 at 1:34:38 AM UTC+1 Eric Shulman wrote:

> For the first problem (excluding items tagged with "Todo"), try this:
> ```
> <$set name="todo" filter="[tag[Todo]]">
> 
> <$macrocall $name="toc-selective-expandable" tag="ML" sort="sort[created]" 
> exclude=<> />
> 
> 
> ```
> Notes:
> * The `$set` widget gets the list of all tiddlers tagged with "Todo" and 
> stores it in the "exclude" variable
> * `` applies the TWCore pre-defined 
> styles to suppress the "numbered bullet item" display
> * Using the `$macrocall` widget instead of the 
> `<>` macro syntax allows you to pass the 
> value of the "exclude" variable as a parameter
>
> To fix the second problem (where the root tag contains an apostrophe), 
> enclose the root tag in double quotes:
> ```
> <>
> ```
> * The `$macrocall` syntax will also handle the second problem , since all 
> the parameter values are already enclosed in double quotes.
>
> Let me know how it goes...
>
> enjoy,
> -e
> On Thursday, January 26, 2023 at 3:32:33 PM UTC-8 jaroslawb...@gmail.com 
> wrote:
>
>> Hello! I am new user of TiddlyWiki, I work on Windows, Google Chrome and 
>> have a problem when creating Table of Contents. 
>>
>> The following code works for me:
>>
>> <>
>>
>> I obtain list of tiddlers tagged *ML*, which is sorted by creation date. 
>> Amazing!
>>
>> But...  2 things:
>>
>> 1) I want to be able to customize this list e.g. ''tiddlers with tag *ML*, 
>> but without tag *Todo*'' etc. So filter notation would be awesome
>> 2) I run into a problem when name of tag tiddler has apostrophe e.g. 
>> *Cauchy's 
>> Integral, *then I am unable to create list of this tag using standard 
>> Table of Contents notation (hence again need of filter notation)
>>
>> So what also works for me is that:
>>
>> <>
>>
>> but I don't seem to be able to do *anything else* to that. What code 
>> lines* do not work* for me:
>>
>>
>>- <>
>>- <>
>>- <>
>>- <>
>>- <>
>>
>> All of the above commands don't produce a thing and I really wish they 
>> worked.
>>
>> I would be really really thankful for help, because I love TiddlyWiki. 
>> And also I'm sorry if that's stupid thing to ask or wrong place to post 
>> such quesion - I am absolute begginer. If that's the case please tell me 
>> what should I do instead. 
>>
>> Have a great day!
>>
>>
>>
>>
>>
>>
>>
>>

-- 
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/a243c78b-a684-42bb-a03c-1652b98bfbe8n%40googlegroups.com.


[tw5] Re: Using Filter Notation in code for Table of Contents

2023-01-26 Thread Eric Shulman
For the first problem (excluding items tagged with "Todo"), try this:
```
<$set name="todo" filter="[tag[Todo]]">

<$macrocall $name="toc-selective-expandable" tag="ML" sort="sort[created]" 
exclude=<> />


```
Notes:
* The `$set` widget gets the list of all tiddlers tagged with "Todo" and 
stores it in the "exclude" variable
* `` applies the TWCore pre-defined 
styles to suppress the "numbered bullet item" display
* Using the `$macrocall` widget instead of the 
`<>` macro syntax allows you to pass the 
value of the "exclude" variable as a parameter

To fix the second problem (where the root tag contains an apostrophe), 
enclose the root tag in double quotes:
```
<>
```
* The `$macrocall` syntax will also handle the second problem , since all 
the parameter values are already enclosed in double quotes.

Let me know how it goes...

enjoy,
-e
On Thursday, January 26, 2023 at 3:32:33 PM UTC-8 jaroslawb...@gmail.com 
wrote:

> Hello! I am new user of TiddlyWiki, I work on Windows, Google Chrome and 
> have a problem when creating Table of Contents. 
>
> The following code works for me:
>
> <>
>
> I obtain list of tiddlers tagged *ML*, which is sorted by creation date. 
> Amazing!
>
> But...  2 things:
>
> 1) I want to be able to customize this list e.g. ''tiddlers with tag *ML*, 
> but without tag *Todo*'' etc. So filter notation would be awesome
> 2) I run into a problem when name of tag tiddler has apostrophe e.g. 
> *Cauchy's 
> Integral, *then I am unable to create list of this tag using standard 
> Table of Contents notation (hence again need of filter notation)
>
> So what also works for me is that:
>
> <>
>
> but I don't seem to be able to do *anything else* to that. What code lines* 
> do not work* for me:
>
>
>- <>
>- <>
>- <>
>- <>
>- <>
>
> All of the above commands don't produce a thing and I really wish they 
> worked.
>
> I would be really really thankful for help, because I love TiddlyWiki. And 
> also I'm sorry if that's stupid thing to ask or wrong place to post such 
> quesion - I am absolute begginer. If that's the case please tell me what 
> should I do instead. 
>
> Have a great day!
>
>
>
>
>
>
>
>

-- 
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/2572f117-9152-4825-94f6-ad877b652279n%40googlegroups.com.