OK, I think I see where we may be at variance;
- In your proposal we can invoke a TOC macro that includes this additional behaviour.
- In my proposal the standard toc does as it always does, unless it comes across condition/child-filter or equivalent fieldname
- ideally default or configured fieldnames
- Thus we need only add such fields to a tiddler that appears in “any toc” for the behaviour to occur.
Another thing I am unclear on @pmario is this is driven by this list and filter as follows;
<$list filter=`[all[shadows+tiddlers]tag<tag>!has[draft.of]$(sort)$] [subfilter<tf.toc-include>] -[<tag>] -[subfilter<exclude>]`>
- Does this not mean when crafting my include I have to craft my exclude to avoid both listing?
- I appreciate the input to this filter is all tiddlers
[all[shadows+tiddlers]
which means exclusion is most likely in custom filters.
*Unlike a “condition” field that replaces the filter above for all children, I will have to specifically rule back in tiddlers that are excluded by tag<tag>!has[draft.of]
The following is untested examples of the filter(s) additions I may have here;
The condition test
... :filter[subfilter{!!condition}else[true]]
- if !!cdondition exists use it, otherwise make the first part of the filter result in true.
The child listing;
<$list
filter=`[subfilter{!!child-filter}]
:else[all[shadows+tiddlers]tag<tag>!has[draft.of]$(sort)$] [subfilter<tf.toc-include>] -[<tag>] -[subfilter<exclude>]`>
...
- if child-filter has a value “on the current node” use it otherwise continue with your proposed filter.
Special note
Unlike your proposal setting the name of the fields tf.toc-include and toc-include I was thinking to provide the field names “condition” and “child-filter” as paramters, to the TOC macro with default set. I could then itterate the same toc using a different set of fieldnames, thus permitting different views of the same content (not unlike your method)
A result what ever is done.
It would be quite easy to update the current tiddlywiki TOC to have simplified and technical views, perhaps avoiding overwhelming new users, but providing a comprehensive TOC for learning or experienced users.