title: $:/core/macros/toc tags: $:/tags/Macro \whitespace trim \procedure toc-defaultItemTemplate() <$let tv-wikilinks="no"> <$transclude $tiddler={{{ [!is[blank]thenelse] }}} $field={{{ [!is[blank]then[text]] :else[!is[blank]thenelse[caption]] }}} > <$view field="title"/> \end \function tf.toc-getItemTemplate() [!is[blank]then] :else[get[toc-itemTemplate]] \procedure _itemTemplate() <$transclude $tiddler=<> > <> \end \procedure toc-open-icon() $:/core/images/down-arrow \procedure toc-closed-icon() $:/core/images/right-arrow \procedure toc-hideField() toc-hide \procedure toc-includeField() toc-include \procedure toc-filterField() toc-filter \function tf.toc-itemClassFilter() [get[text]matchthen[toc-item-selected]else[toc-item]] \function tf.toc-includeClass() [subfiltermatchthen[toc-item-include]] \function tf.toc-filterClass() [subfiltermatchthen[toc-item-filter]] \function tf.toc-hideClass() [!is[blank]then[toc-item-hide]] \function tf.toc-itemClass() [] [] [] [] +[join[ ]] \function tf.toc-getHideText() [get] \function tf.toc-hideIsYes() [format:titlelist[]] \function tf.toc-hide() [match[yes]then] :else[] \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[]] \function tf.toc-filterString() [!is[blank]then] :else[!is[blank]thenelse] \function tf.toc-newPath() [addsuffix[/]addsuffix] \procedure toc-body(tag,sort:"",itemClassFilter,exclude,path) <$set name=currentTiddler filter="[!is[blank]thenelse]">
    <$list filter=` [subfilter] :else[subfilter$(sort)$] [subfilter] -[] -[subfilter]`> <%if [] -[subfilter] %> <$let item=<> _path=<> > <$set name="_excluded" filter="[subfilter] [] [subfilter]">
  1. >> <% if [all[current]toc-link[no]] %> <<_itemTemplate>> <% else %> <$link to={{{ [get[target]else] }}}> <<_itemTemplate>> <% endif %> <$macrocall $name="toc-body" tag=<> exclude=<<_excluded>> path=<<_path>> />
  2. <% endif %>
\end \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]] %> <<_itemTemplate>> <% endif %> <% elseif [get[text]match[open]] %> <$button setTitle=<> setTo="close" class="tc-btn-invisible tc-popup-keep" tooltip=<>> <$transclude tiddler=<> /> <% if [match[yes]] %> <<_itemTemplate>> <% endif %> <% endif %> \end \function tf.toc-stateTitle() [[$:/state/toc]] [] "/" [] +[join[]] \procedure toc-linked-expandable-body(tag,sort:"",itemClassFilter,exclude,path,tagField,parentField,captionField,itemTemplate) <$qualify name="toc-state" title=<> >
  • >> <$link to={{{ [get[target]else] }}}> <> <<_itemTemplate>> <% if [get[text]match[open]] %> <$macrocall $name="toc-expandable" tag=<> sort=<> exclude=<> path=<> tagField=<> parentField=<> captionField=<> itemTemplate=<> /> <% endif %>
  • \end \procedure toc-unlinked-expandable-body(tag,sort:"",itemClassFilter,exclude,path,tagField,parentField,captionField,itemTemplate) <$qualify name="toc-state" title=<>>
  • >> <> <% if [get[text]match[open]] %> <$macrocall $name="toc-expandable" tag=<> sort=<> exclude=<> path=<> tagField=<> parentField=<> captionField=<> itemTemplate=<> /> <% endif %>
  • \end \procedure toc-expandable(tag,sort:"",itemClassFilter:"",exclude,path,tagField,parentField,captionField,itemTemplate) <$set name=currentTiddler filter="[!is[blank]thenelse]">
      <$list filter=` [subfilter] :else[subfilter$(sort)$] [subfilter] -[] -[subfilter]`> <%if [] -[subfilter] %> <$let _path=<>> <$set name="_excluded" filter="[subfilter] [] [subfilter]"> <% if [all[current]toc-link[no]] %> <$macrocall $name="toc-unlinked-expandable-body" tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> tagField=<> parentField=<> captionField=<> itemTemplate=<> /> <% else %> <$macrocall $name="toc-linked-expandable-body" tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> tagField=<> parentField=<> captionField=<> itemTemplate=<> /> <% endif %> <% endif %>
    \end \function tf.toc-curTidInclude() [get] \procedure toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path,tagField,parentField,captionField,itemTemplate) <$qualify name="toc-state" title=<>>
  • >> <$link to={{{ [get[target]else] }}}> <% if [has] :filter[getmatch<..currentTiddler>] +[limit[1]] %> <> <% elseif [all[current]tagging[]] [subfilter] -[subfilter] +[limit[1]] %> <> <% else %> <$button class='tc-btn-invisible'> {{$:/core/images/blank}} <% endif %> <<_itemTemplate>> <% if [get[text]match[open]] %> <$macrocall $name="toc-selective-expandable" tag=<> sort=<> exclude=<> path=<> tagField=<> parentField=<> captionField=<> itemTemplate=<> /> <% endif %>
  • \end \procedure toc-unlinked-selective-expandable-body(tag,sort:"",itemClassFilter,exclude,path,tagField,parentField,captionField,itemTemplate) <$qualify name="toc-state" title=<> >
  • >> <% if [has] :filter[getmatch<..currentTiddler>] +[limit[1]] %> <> <% elseif [all[current]tagging[]] [subfilter] -[subfilter] +[limit[1]] %> <> <% else %> <$button class="tc-btn-invisible"> {{$:/core/images/blank}} <<_itemTemplate>> <% endif %> <% if [get[text]match[open]] %> <$macrocall $name="toc-selective-expandable" tag=<> sort=<> exclude=<> path=< tagField=<> parentField=<> captionField=<> itemTemplate=<> /> <% endif %>
  • \end \procedure toc-selective-expandable(tag,sort:"",itemClassFilter,exclude,path,tagField,parentField,captionField,itemTemplate) <$set name=currentTiddler filter="[!is[blank]thenelse]">
      <$list filter=` [subfilter] :else[subfilter$(sort)$] [subfilter] -[] -[subfilter]`> <%if [] -[subfilter] %> <$let _path=<>> <$set name="_excluded" filter="[subfilter] [] [subfilter]"> <% if [all[current]toc-link[no]] %> <$macrocall $name="toc-unlinked-selective-expandable-body" tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> tagField=<> parentField=<> captionField=<> itemTemplate=<> /> <% else %> <$macrocall $name="toc-linked-selective-expandable-body" tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> tagField=<> parentField=<> captionField=<> itemTemplate=<> /> <% endif %> <% endif %>
    \end \procedure toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"",exclude,tagField,parentField,captionField,itemTemplate) <$tiddler tiddler={{{ [get[text]] }}}>
    <$linkcatcher to=<>>
    <$macrocall $name="toc-selective-expandable" tag=<> sort=<> exclude=<> tagField=<> parentField=<> captionField=<> itemTemplate=<> />
    <$reveal stateTitle=<> type="nomatch" text=""> <$transclude mode="block" tiddler=<