The TWCore toc
macros store the opened/closed state of each branch in system tiddlers that start with a prefix of $:/state/toc
. By default, these state tiddlers are retained when you save your TiddlyWiki file. You can prevent these tiddlers from being saved by doing the following:
- Create a tiddler (e.g., “ResetTOCStates”), tagged with
$:/tags/Macro
- In the body text of this tiddler, enter
\define publishFilter() -[prefix[$:/state/toc]]
The publishFilter
macro is used in $:/core/save/all
to add or remove selected tiddlers from the saveTiddlerFilter
definition that controls which tiddlers are to be saved in the file when the "Save changes"
button is pressed.
By specifying “-[prefix[$:/state/toc]]
” in your publishFilter
macro, you are telling the TWCore to NOT save those tiddlers in the file. Thus, when you save-and-reload your file, all the TOCs in your TiddlyWiki are automatically returned to their initial default state.
enjoy,
-e