Open ericshulman opened 1 year ago
If the exclude
parameter could be a real filter, I think that would make sense and we could officially document it. At the moment it's not documented, because of the internal use of enlist
.
If I remember it right, the subfilter
operator was not available as we did rewrite the recursion protection.
@ericshulman -- This one should also be fixed. see: https://tiddlywiki.com/#Table-of-Contents%20Macros
Normally, the TOC code dynamically builds an "exclude" list containing tiddler titles that have already been "visited" in the current branch. This prevents infinite recursion when a "tag loop" occurs. However, it is also possible to pass in an initial list of titles to exclude by using:
Recently, someone asked (https://talk.tiddlywiki.org/t/tw5-using-filter-notation-in-code-for-table-of-contents/6034) how to use a filter to exclude tiddlers that have a specific tag value (e.g., "
[tag[Todo]]
").I provided a solution that first gets the list of all tiddlers with that tag, so that list can then be passed as the initial value of the
exclude
parameter:This approach was necessary because internal to the TWCore TOC macro code, the list of excluded tiddler titles is handled using
[enlist<__exclude__>]
and-[enlist<__exclude__>]
.If these code instances were changed to
[subfilter<__exclude__>]
and-[subfilter<__exclude__>]
, then the initial value of theexclude
parameter could directly contain filter syntax, like this: