From cf35a264a82c83a67d8bb9db4b600ed512917989 Mon Sep 17 00:00:00 2001 From: pmario Date: Fri, 9 Feb 2024 12:23:24 +0100 Subject: [PATCH] updated inline docs --- core/wiki/macros/toc.tid | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index 65dd30966..589f827d6 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -7,6 +7,12 @@ Naming rules / pattern - procedures eg: toc-procedureName, - macro parameters: path, itemTemplate - derived macro parameters: _path, _itemTemplate -> derived variables start with an underscore + +The toc macro code gets more and more complex from top to bottom. +toc-tabbed-internal-nav calls toc-tabbed-external-nav, which callse toc-selective-expandable, which calls toc-expandable + +The very first toc macro is _not_ "reused". So it can be used as a "simple" reverence implementation, +because it is realatively easy to debug. --> \whitespace trim @@ -59,12 +65,12 @@ Naming rules / pattern \function tf.toc-include() [get] \function tf.toc-filter() [get] - + \procedure toc-filterDefault() [all[shadows+tiddlers]tag!has[draft.of]] \procedure toc-filterParent() [has!has[draft.of]] :filter[getmatch] \procedure toc-filterTagLike() [getenlist-input[]!has[draft.of]] - + \function tf.toc-filterString() [!is[blank]then] :else[!is[blank]thenelse] @@ -72,12 +78,21 @@ Naming rules / pattern \function tf.toc-newPath() [addsuffix[/]addsuffix] + +\procedure toc(tag,sort:"",itemClassFilter,exclude,captionField,tagField,parentField,itemTemplate) + <$macrocall $name="toc-body" tag=<> sort=<> exclude=<>/> +\end + \procedure toc-body(tag,sort:"",itemClassFilter,exclude,path) <$set name=currentTiddler filter="[!is[blank]thenelse]">
    - + <$list filter=` [subfilter] :else[subfilter$(sort)$] [subfilter] -[] -[subfilter]`> @@ -110,15 +125,7 @@ Naming rules / pattern - -\procedure toc(tag,sort:"",itemClassFilter,exclude,captionField,tagField,parentField,itemTemplate) -<$macrocall $name="toc-body" tag=<> sort=<> exclude=<>/> -\end - + \procedure toc-tagLikeChildFilter() [getenlist-input[]] \procedure toc-parentChildFilter() [has] :filter[getmatch<..currentTiddler>] \procedure toc-tagChildFilter() [tag] @@ -129,6 +136,7 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter :else[!is[blank]thenelse] \end + \procedure toc-openBranch(path,currentTiddler,manual:"no") \procedure recursiveOpen(exclude, path) @@ -147,6 +155,7 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter \end recursiveOpen + <% if [match[yes]] %> <$qualify name="toc-state" title=<> > <$action-setfield $tiddler=<> text="open"/>