If I go TiddlyWiki site I can see tab Content. How can I create my own table of content for my tiddlywiki file?
Create a new tiddler and give the title Contents
Under tags, give the value $:/tags/SideBar
Under type the text for this tiddler, give
<$list filter={{$:/core/Filters/AllTiddlers!!filter}} template="$:/core/ui/ListItemTemplate"/>
I found the documentation for this really confusing, but here's what I did that works best:
<div class="tc-table-of-contents">
<<toc-selective-expandable 'TableOfContents' sort[ind]>>
</div>
Then, tag each tiddler with TableofContents.
Lastly, when editing each tiddler, add a new field named "ind" (for index - you can change this to whatever you like, so long as it's not being used elsewhere, of course). Assign a value to "ind" starting with 0 to tell it what order you want the tiddlers to go in. I incremented by 10 instead of 1 in case I want to rearrange a few things or insert more in the middle.
Create a new tiddler and give the title Contents
Under tags, give the value $:/tags/SideBar
Under type the text for this tiddler, give
<$list filter={{$:/core/Filters/AllTiddlers!!filter}} template="$:/core/ui/ListItemTemplate"/>
This is explained in the documentation.
The short version: Add some tag (e.g. Content
) to the pages you want to appear in the TOC; then in the place where you want it to appear, use one of the macros with that tag name (e.g. <<toc Content>>
). To make a nested TOC, tag pages with the names of tags that appeared at the top level. So for example if you have a tiddler named First
that is tagged with Content
, then you can tag more tiddlers with First
, and they will appear indented below First
in the TOC.
© 2022 - 2024 — McMap. All rights reserved.