Here’s a specialized recursive “toc-list” macro that will give you a flat list of all titles contained in a given TOC, starting from a specified “root” tag value (e.g., “TableOfContents”):
\define toc-list(here,max,exclude,level:"1",field:"tags")
<!-- SHOW ALL TITLES AS FLAT LIST -->
<$list filter="""[contains:$field$[$here$]sortby{$here$!!list}] $exclude$ -[[$here$]]""">
<$text text="[["/><<currentTiddler>><$text text="]]"/><br>
<$reveal default="$level$" type="nomatch" text="$max$">
<$macrocall $name="toc-list" here=<<currentTiddler>> max="$max$" exclude="""$exclude$ -[[$here$]]""" level={{{ [[$level$]add[1]] }}} field=<<__field__>>/>
</$reveal>
</$list>
\end
To find all tiddlers that are NOT included in the TOC, you can write something like this:
<$wikify name="TOCtids" text=<<toc-list "TableOfContents">>>
<$list filter="[all[tiddlers]!enlist<TOCtids>]"><<currentTiddler>><br></$list>
The $wikify
widget invokes the <<toc-list>>
macro to get the flat list of tiddlers that ARE in the TOC (TOCtids
). Then, the $list
widget that follows it shows you a list of all tiddlers that are not in the TOCtids
list.
For more TOC goodies, see TiddlyTools/TOC and TiddlyTools/TOC/ItemTemplate
enjoy,
-e