1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-30 16:00:46 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid
Jermolene 8041e3bef2 Add a sort parameter to the TOC macro
As requested by @giffmex
2014-08-20 22:48:07 +01:00

30 lines
1.1 KiB
Plaintext

title: TableOfContentsMacro
tags: macros
modified: 20140818180307785
The table of contents macro produces a hierarchical tree of tiddlers based on their tags.
The top level entries of the table of contents are defined by a root tag. The subentries under each of those entries are tagged with the title of the entry. Entries can be ordered using the `list` field as described in TiddlerTags.
There are several variants of the macro:
* `<<toc>>` produces a simple hierarchical tree of links
* `<<toc-expandable>>` produces an expandable tree of links
* `<<toc-selective-expandable>>` produces an expandable tree of links where the expand/contract buttons are only shown for entries that possess child nodes
! Parameters
|!Position |!Name |!Description |!Default |
|1st |tag |The root tag that identifies the top level of the hierarchy | |
|2nd |sort |Optional sorting subfilter (eg `sort[title]`) | |
The ''tag'' and ''sort'' parameters are combined to make a filter expression of the form:
```
[tag[$tag$]$sort$]
```
! Examples
<<tabs "[tag[table-of-contents-example]]" "TableOfContentsMacro Simple Example">>