Toc uses currentTiddler as "tag" default parameter if it is missing (#8291)

* toc's use currentTiddler, if tag prameter is undefined

* add currentTiddler info to toc documentation
This commit is contained in:
Mario Pietsch
2024-10-24 17:39:18 +01:00
committed by GitHub
parent c060216a8e
commit b68de0d69f
2 changed files with 46 additions and 33 deletions
@@ -1,27 +1,31 @@
created: 20140919155729620
modified: 20230427125500432
modified: 20240624102502089
tags: Macros [[Core Macros]]
title: Table-of-Contents Macros
type: text/vnd.tiddlywiki
~TiddlyWiki provides several macros for generating a tree of tiddler links by analysing [[tags|Tagging]]:
;<<.var toc>>
; <<.var toc>>
: A simple tree
;<<.var toc-expandable>>
; <<.var toc-expandable>>
: A tree in which all the branches can be expanded and collapsed
;<<.var toc-selective-expandable>>
; <<.var toc-selective-expandable>>
: A tree in which the non-empty branches can be expanded and collapsed
;<<.var toc-tabbed-internal-nav>> and <<.var toc-tabbed-external-nav>>
; <<.var toc-tabbed-internal-nav>> and <<.var toc-tabbed-external-nav>>
: A two-panel browser:
:* on the left, a selectively expandable tree that behaves like a set of vertical tabs
:* on the right, the content of whichever tiddler the user selects in the tree
The difference between the last two has to do with what happens when the user clicks a link in the right-hand panel:
;<<.var toc-tabbed-internal-nav>>
; <<.var toc-tabbed-internal-nav>>
: The target tiddler appears in the right-hand panel, replacing the tiddler that contained the link
;<<.var toc-tabbed-external-nav>>
; <<.var toc-tabbed-external-nav>>
: The target tiddler appears in the normal way (which depends on the user's configured storyview)
!! Structure
@@ -42,9 +46,11 @@ To make a table of contents appear in the sidebar, see [[How to add a new tab to
!! Parameters
;tag
; tag
: The root tag that identifies the top level of the tree
;sort
: <<.from-version "5.3.5">> If the <<.param tag>> parameter is "missing" or "an empty" string, the <<.var curretTiddler>> variable is used
; sort
: An optional extra [[filter step|Filter Step]], e.g. `sort[title]`
These two parameters are combined into a single [[filter expression|Filter Expression]] like this: