From 745c7fbbcd8616e370bacf355ef1200c21eeacef Mon Sep 17 00:00:00 2001 From: pmario Date: Sat, 3 Feb 2024 03:04:41 +0100 Subject: [PATCH] toc-exclude works, but should be improved --- core/wiki/macros/toc.tid | 50 +++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index d486171ae..294815dc7 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -25,31 +25,45 @@ tags: $:/tags/Macro \end + +\function tf.toc-include() [get[toc-include]] + + +\function tf.toc-exclude() [get[toc-exclude]] +\function tf.toc-excludeYes() [format:titlelist[]] + \procedure toc-body(tag,sort:"",itemClassFilter,exclude,path)
    - <$list filter=`[all[shadows+tiddlers]tag!has[draft.of]$(sort)$] -[] -[subfilter]`> - <$let item=<> __path=<> > - <$set name="__excluded" filter="[subfilter] []"> -
  1. >> - <% if [all[current]toc-link[no]] %> - <> - <% else %> - - <$link to={{{ [get[target]else] }}}> - <> - - <% endif %> - <$macrocall - $name="toc-body" - tag=<> sort=<> itemClassFilter=<> exclude=<<__excluded>> path=<<__path>> - /> -
  2. - + <$list filter=`[all[shadows+tiddlers]tag!has[draft.of]$(sort)$] [subfilter] -[] -[subfilter]`> + <$let _toc-exclude={{{ [match[yes]then] :else[] }}} > + <%if [] -[subfilter<_toc-exclude>] %> + <$let item=<> _path=<> > + <$set name="_excluded" filter="[subfilter] [] [subfilter<_toc-exclude>]"> +
  3. >> + <% if [all[current]toc-link[no]] %> + <> + <% else %> + + <$link to={{{ [get[target]else] }}}> + <> + + <% endif %> + <$macrocall + $name="toc-body" + tag=<> sort=<> itemClassFilter=<> exclude=<<_excluded>> path=<<_path>> + /> +
  4. + + + <% endif %>
\end + + +