Hi Eric,

Thanks for the backgrounder. The problem with using the exclude filter (or 
the sort parameter) is that although the child tiddlers are snipped away, 
the "branch" is still left with it's open/close arrow, which is a bit 
distracting. I remember that this has come up in other threads, so 
"pruning" the branch (making it into a standard link) seems to be a 
recurring request. I'm looking at the code, trying to see where it might be 
possible to introduce a list of branches to be pruned (e.g. "Learning 
[[Customise 
TiddlyWiki <https://tiddlywiki.com/#Customise%20TiddlyWiki>]]") but it's 
easy to get lost in the code ;-)

Thanks!
-- Mark

On Thursday, October 4, 2018 at 9:30:23 AM UTC-7, Eric Shulman wrote:
>
> On Thursday, October 4, 2018 at 7:35:18 AM UTC-7, Mark S. wrote:
>>
>> It turns out there is an undocumented "exclude" option, so if you can try 
>> that method if you want and see if it works better.
>>
>
> Some years ago, when the TOC macros were first written, they had a problem 
> with infinite recursion if a tiddler was tagged with the tag of a "parent 
> node" in the tree.
>
> To address this, I added an *internal* variable, "exclude", that is used 
> during the recursion to automatically keep track of which tiddlers have 
> already been listed in the tree, so that they won't get displayed more than 
> once and create circular references.  The value of the exclude param is a 
> "negative filter"... that is, it uses TW filter syntax to remove matching 
> titles from consideration, like this: "-[[SomeTitle]]".  As the recursion 
> progresses, more titles are added...e.g., "-[[Foo]] -[[Bar]] -[[Baz]]".
>
> Normally, when invoking a TOC macro, the "exclude" filter value defaults 
> to blank, so that all tiddlers in the tree will be shown.  However, if you 
> DO provide an initial filter value for the exclude param, any titles 
> matching that filter will be suppressed without being displayed even once.  
> Thus, you can use exclude="-[tag[Gronk]]".
>
> Important note: every term in the exclude filter MUST be a negated term 
> (with the "-" prefix) or it will CAUSE infinite recursion.  For example, if 
> you write exclude="[tag[Foo]]" instead of exclude="-[tag[Foo]]", then all 
> tiddlers tagged "Foo" will be treated as matching tiddlers at *every* level 
> of the tree and the code will recurse until the browser crashes.
>
> It's just too easy to break things just by missing a single leading "-" on 
> any filter term.  Perhaps for this reason more than anything else, the 
> variable -- while necessary for internally preventing infinite recursion -- 
> is not documented for general use as an input param.
>
> -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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4f1121e7-5abb-4a27-9bc3-186cfd8cc6e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to