diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index e3b982619..d486171ae 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -7,7 +7,7 @@ tags: $:/tags/Macro \procedure toc-open-icon() $:/core/images/down-arrow \procedure toc-closed-icon() $:/core/images/right-arrow - + \function tf.toc-stateTitle() [[$:/state/toc]] [] "/" [] +[join[]] \function tf.toc-newPath() [addsuffix[/]addsuffix] @@ -17,11 +17,11 @@ tags: $:/tags/Macro \procedure toc-caption() -<$set name="tv-wikilinks" value="no"> +<$let name="tv-wikilinks" value="no"> <$transclude field="caption"> <$view field="title"/> - + \end @@ -29,19 +29,20 @@ tags: $:/tags/Macro
    <$list filter=`[all[shadows+tiddlers]tag!has[draft.of]$(sort)$] -[] -[subfilter]`> - <$let item=<> path=<> > - <$set name="excluded" filter="[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=<> path=<> + tag=<> sort=<> itemClassFilter=<> exclude=<<__excluded>> path=<<__path>> />
  2. @@ -64,26 +65,27 @@ This macro is _not_ used by other toc-macros If a toc-item should not show a link, the toc-caption is part of the button. So it can be clicked to open / close the branch --> \procedure toc-item(isUnlinked:"") - <% if [get[text]else[close]match[close]] %> - <$button setTitle=<> setTo="open" class="tc-btn-invisible tc-popup-keep" tooltip=<>> - <$transclude tiddler=<> /> - <% if [match[yes]] %> - <> - <% endif %> - - <% elseif [get[text]match[open]] %> - <$button setTitle=<> setTo="close" class="tc-btn-invisible tc-popup-keep" tooltip=<>> - <$transclude tiddler=<> /> - <% if [match[yes]] %> - <> - <% endif %> - - <% endif %> +<% if [get[text]else[close]match[close]] %> + <$button setTitle=<> setTo="open" class="tc-btn-invisible tc-popup-keep" tooltip=<>> + <$transclude tiddler=<> /> + <% if [match[yes]] %> + <> + <% endif %> + +<% elseif [get[text]match[open]] %> + <$button setTitle=<> setTo="close" class="tc-btn-invisible tc-popup-keep" tooltip=<>> + <$transclude tiddler=<> /> + <% if [match[yes]] %> + <> + <% endif %> + +<% endif %> \end \procedure toc-linked-expandable-body(tag,sort:"",itemClassFilter,exclude,path) <$qualify name="toc-state" title=<> >
  3. >> + <$link to={{{ [get[target]else] }}}> <> <> @@ -118,20 +120,20 @@ This macro is _not_ used by other toc-macros Shows an expandable toc. Item always have an open/close chevron =============================================================== --> \procedure toc-expandable(tag,sort:"",itemClassFilter:"",exclude,path) -<$let path=<>> - <$set name="excluded" filter="[subfilter] []"> +<$let __path=<>> + <$set name="__excluded" filter="[subfilter] []">
      <$list filter=`[all[shadows+tiddlers]tag!has[draft.of]$(sort)$] -[] -[subfilter]`> <% if [all[current]toc-link[no]] %> <$macrocall $name="toc-unlinked-expandable-body" - tag=<> sort=<> itemClassFilter=<> exclude=<> path=<> + tag=<> sort=<> itemClassFilter=<> exclude=<<__excluded>> path=<<__path>> /> <% else %> <$macrocall $name="toc-linked-expandable-body" - tag=<> sort=<> itemClassFilter=<> exclude=<> path=<> + tag=<> sort=<> itemClassFilter=<> exclude=<<__excluded>> path=<<__path>> /> <% endif %> @@ -143,6 +145,7 @@ Shows an expandable toc. Item always have an open/close chevron \procedure toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path) <$qualify name="toc-state" title=<>>
    1. >> + <$link to={{{ [get[target]else] }}}> <% if [all[current]tagging[]] -[subfilter] +[limit[1]] %> <> @@ -193,20 +196,20 @@ Shows a selctive expandable toc. If an item has no children, there is no open/close chevron ========================================================== --> \procedure toc-selective-expandable(tag,sort:"",itemClassFilter,exclude,path) -<$let tag=<> sort=<> itemClassFilter=<> path=<>> - <$set name="excluded" filter="[subfilter] []"> +<$let __path=<>> + <$set name="__excluded" filter="[subfilter] []">
        <$list filter=`[all[shadows+tiddlers]tag!has[draft.of]$(sort)$] -[] -[subfilter]`> <% if [all[current]toc-link[no]] %> <$macrocall $name="toc-unlinked-selective-expandable-body" - tag=<> sort=<> itemClassFilter=<> exclude=<> path=<> + tag=<> sort=<> itemClassFilter=<> exclude=<<__excluded>> path=<<__path>> /> <% else %> <$macrocall $name="toc-linked-selective-expandable-body" - tag=<> sort=<> itemClassFilter=<> exclude=<> path=<> + tag=<> sort=<> itemClassFilter=<> exclude=<<__excluded>> path=<<__path>> /> <% endif %>