diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index 2c1e172da..fbcad01a3 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -3,11 +3,11 @@ tags: $:/tags/Macro \whitespace trim -\procedure toc-captionField() +\procedure toc-defaultItemTemplate() <$let tv-wikilinks="no"> - <$transclude $tiddler={{{ [!is[blank]thenelse] }}} - $field={{{ [!is[blank]then[text]] :else[!is[blank]thenelse[caption]] }}} + <$transclude $tiddler={{{ [!is[blank]thenelse] }}} + $field={{{ [!is[blank]then[text]] :else[!is[blank]thenelse[caption]] }}} > <$view field="title"/> @@ -15,6 +15,15 @@ tags: $:/tags/Macro \end + +\function tf.toc-getItemTemplate() [!is[blank]then] :else[get[toc-itemTemplate]] + +\procedure toc-itemTemplate() +<$transclude $tiddler=<> > + <> + +\end + \procedure toc-open-icon() $:/core/images/down-arrow \procedure toc-closed-icon() $:/core/images/right-arrow @@ -67,11 +76,11 @@ tags: $:/tags/Macro <$set name="_excluded" filter="[subfilter] [] [subfilter]">
  • >> <% if [all[current]toc-link[no]] %> - <> + <> <% else %> <$link to={{{ [get[target]else] }}}> - <> + <> <% endif %> <$macrocall @@ -94,28 +103,28 @@ Simple toc macro which alwayse shows the full tree This macro is _not_ used by other toc-macros v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter ================================================================== --> -\procedure toc(tag, sort:"", itemClassFilter, exclude, tagField, parentField, captionField, captionFieldTemplate) +\procedure toc(tag, sort:"", itemClassFilter, exclude, tagField, parentField, captionField, itemTemplate) <$macrocall $name="toc-body" tag=<> sort=<> exclude=<>/> \end \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 %> @@ -123,27 +132,27 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter \function tf.toc-stateTitle() [[$:/state/toc]] [] "/" [] +[join[]] -\procedure toc-linked-expandable-body(tag,sort:"",itemClassFilter,exclude,path,captionField,captionFieldTemplate) +\procedure toc-linked-expandable-body(tag,sort:"",itemClassFilter,exclude,path,captionField,itemTemplate) <$qualify name="toc-state" title=<> >
  • >> <$link to={{{ [get[target]else] }}}> <> - <> + <> <% if [get[text]match[open]] %> <$macrocall $name="toc-expandable" tag=<> sort=<> exclude=<> path=<> - captionField=<> captionFieldTemplate=<> + captionField=<> itemTemplate=<> /> <% endif %>
  • \end -\procedure toc-unlinked-expandable-body(tag,sort:"",itemClassFilter,exclude,path,captionField,captionFieldTemplate) +\procedure toc-unlinked-expandable-body(tag,sort:"",itemClassFilter,exclude,path,captionField,itemTemplate) <$qualify name="toc-state" title=<>>
  • >> <> @@ -152,7 +161,7 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter <$macrocall $name="toc-expandable" tag=<> sort=<> exclude=<> path=<> - captionField=<> captionFieldTemplate=<> + captionField=<> itemTemplate=<> /> <% endif %>
  • @@ -162,7 +171,7 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter -\procedure toc-expandable(tag,sort:"",itemClassFilter:"",exclude,path, captionField, captionFieldTemplate) +\procedure toc-expandable(tag,sort:"",itemClassFilter:"",exclude,path, captionField, itemTemplate)
      <$list filter=` [subfilter] @@ -175,13 +184,13 @@ Shows an expandable toc. Item always have an open/close chevron <$macrocall $name="toc-unlinked-expandable-body" tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> - captionField=<> captionFieldTemplate=<> + captionField=<> itemTemplate=<> /> <% else %> <$macrocall $name="toc-linked-expandable-body" tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> - captionField=<> captionFieldTemplate=<> + captionField=<> itemTemplate=<> /> <% endif %> @@ -193,7 +202,7 @@ Shows an expandable toc. Item always have an open/close chevron \function tf.toc-curTidInclude() [get] -\procedure toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path,captionField,captionFieldTemplate) +\procedure toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path,captionField,itemTemplate) <$qualify name="toc-state" title=<>>
    1. >> @@ -206,21 +215,21 @@ Shows an expandable toc. Item always have an open/close chevron {{$:/core/images/blank}} <% endif %> - <> + <> <% if [get[text]match[open]] %> <$macrocall $name="toc-selective-expandable" tag=<> sort=<> exclude=<> path=<> - captionField=<> captionFieldTemplate=<> + captionField=<> itemTemplate=<> /> <% endif %>
    2. \end -\procedure toc-unlinked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path,captionField,captionFieldTemplate) +\procedure toc-unlinked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path,captionField,itemTemplate) <$qualify name="toc-state" title=<> >
    3. >> <% if [all[current]tagging[]] [subfilter] -[subfilter] +[limit[1]] %> @@ -230,7 +239,7 @@ Shows an expandable toc. Item always have an open/close chevron {{$:/core/images/blank}} - <> + <> <% endif %> @@ -238,7 +247,7 @@ Shows an expandable toc. Item always have an open/close chevron <$macrocall $name="toc-selective-expandable" tag=<> sort=<> exclude=<> path=< - captionField=<> captionFieldTemplate=<> + captionField=<> itemTemplate=<> /> <% endif %>
    4. @@ -249,7 +258,7 @@ Shows an expandable toc. Item always have an open/close chevron 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,captionField,captionFieldTemplate) +\procedure toc-selective-expandable(tag,sort:"",itemClassFilter,exclude,path,captionField,itemTemplate)
        <$list filter=` [subfilter] @@ -262,13 +271,13 @@ If an item has no children, there is no open/close chevron <$macrocall $name="toc-unlinked-selective-expandable-body" tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> - captionField=<> captionFieldTemplate=<> + captionField=<> itemTemplate=<> /> <% else %> <$macrocall $name="toc-linked-selective-expandable-body" tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> - captionField=<> captionFieldTemplate=<> + captionField=<> itemTemplate=<> /> <% endif %> @@ -282,7 +291,7 @@ If an item has no children, there is no open/close chevron Shows a tabbed toc. If a toc-item link is clicked it will open the tiddler in the story =================================================================== --> -\procedure toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"",exclude, captionField, captionFieldTemplate) +\procedure toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"",exclude, captionField, itemTemplate) <$tiddler tiddler={{{ [get[text]] }}}>
        <$linkcatcher to=<>> @@ -294,14 +303,14 @@ If a toc-item link is clicked it will open the tiddler in the story sort=<> exclude=<> captionField=<> - captionFieldTemplate=<> + itemTemplate=<> />
        <$reveal stateTitle=<> type="nomatch" text=""> <$transclude mode="block" tiddler=<