Example requested: New features in 5.1.18 for search and subfilter operators [toc macros affected]

154 views
Skip to first unread message

Mohammad

unread,
Oct 31, 2018, 11:42:09 PM10/31/18
to TiddlyWiki
Last night Jeremy has updated the https://tiddlywiki.com/prerelease/ with two new features
  • search operator which has significant enhances in 5.1.18
  • subfilter operator which can be used in toc macros


# Using subfilter with toc macro, the exclude attribute

Assume you have several tiddlers tagged with myTag and you want to build a table of contents but you want to exclude few of them e.g tid-a, tid-b, tid-c

<<toc-selective-expandable 
tag:"myTag" 
exclude:"[subfilter[tid-a tid-b tid-e]]">>


Another example:

Assume you have several tiddlers tagged with tt and there are some of them ALSO have been tagged with tts, how to build a TOC excluding those tagged with tts"

<$set name="myFilter" value="[tag[tts]]">
  <<toc-selective-expandable 
    tag:"tt" 
    exclude:"[subfilter<myFilter>]">>
</$set>




More example requested
 Take a look here: https://github.com/Jermolene/TiddlyWiki5/pull/3508 and give more semantic examples


- Mohammad

PMario

unread,
Nov 1, 2018, 6:05:06 AM11/1/18
to TiddlyWiki
Hi Mohammad,

I'm sorry to say. But your assumptions about the "exclude" parameter are completely wrong!

I'll explain the details in the next post.

-m

PMario

unread,
Nov 1, 2018, 6:14:42 AM11/1/18
to TiddlyWiki
Hi,

If you have a closer look at the toc-macro docs, you'll see, that there is _no_ exclude parameter. ... It is only used as an internal measure to protect the system from endless loops.

-m

PMario

unread,
Nov 1, 2018, 6:19:50 AM11/1/18
to TiddlyWiki

On Thursday, November 1, 2018 at 4:42:09 AM UTC+1, Mohammad wrote:

More example requested
 Take a look here: https://github.com/Jermolene/TiddlyWiki5/pull/3508 and give more semantic examples


It's way to early, to use this function. It is experimental at the moment and subject to change or being completely removed. It's buggy at the moment of writing.

-m

PMario

unread,
Nov 1, 2018, 6:51:59 AM11/1/18
to TiddlyWiki
On Thursday, November 1, 2018 at 4:42:09 AM UTC+1, Mohammad wrote:
....
Assume you have several tiddlers tagged with myTag and you want to build a table of contents but you want to exclude few of them e.g tid-a, tid-b, tid-c

<<toc-selective-expandable 
tag:"myTag" 
exclude:"[subfilter[tid-a tid-b tid-e]]">>


Hi Mohammad,

Your desire to use an exclude parameter is valid! ... But at the moment it just doesn't work that way!

At the moment the exclude parameter is meant for internal use only! ... If it gets "wrong" parameters, there is a very high chance to create unwanted side effects.

So please give us time that we can think about an exclude parameter that works in a way how users expect it.

have fun!
mario






Mohammad

unread,
Nov 1, 2018, 7:15:13 AM11/1/18
to TiddlyWiki
Hello Mario,
 Thank you for your clarification!
I will wait for final release and your notice! If you think this post shall be deleted completely, please let me know.

Mohammad

TonyM

unread,
Nov 1, 2018, 8:03:33 AM11/1/18
to TiddlyWiki
Mohamad

I am sure I have shared a macro to do this recently. I will be "on the road" for a few days bit have a search here. Otherwise I can give you a custom toc for this. I belive it was before I and bimlas started collaborating on the kin opperator.

Otherwise, I can provide it monday, sydney time.

Regards
Tony

Mohammad

unread,
Nov 1, 2018, 8:10:25 AM11/1/18
to TiddlyWiki
Thank you Tony!
I will remain! Yes please share! The toc macro in TW5.1.18 seems need some work to do the job!

-Mohammad

TonyM

unread,
Nov 1, 2018, 6:44:10 PM11/1/18
to TiddlyWiki
Mohammad,


Except for formatting to look like a TOC and Not a list the code there shows how to make recursive macros to "walk" a tree like a toc, and the filter determines which of the items found is displayed.

Regards
Tony

Mohammad

unread,
Nov 2, 2018, 12:53:59 AM11/2/18
to TiddlyWiki
Thank you Tony!
It is helpful for my case.


Cheers
Mohammad
Reply all
Reply to author
Forward
0 new messages