diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index e00b90578..f516191c7 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -26,19 +26,23 @@ The very first toc macro is _not_ reused. So it can be used as a simple referenc \procedure toc-defaultItemTemplate() -<$let tv-wikilinks="no" - field={{{ [] :cascade[<_hasItemTemplate>append<_hasCaptionField>append<_hasCaption>append[title]] }}} -> - > +<%if [<_mode>match[tagMode][toc-caption]is[variable]] %> + <$transclude $variable="toc-caption"/> +<%else%> + <$let tv-wikilinks="no" + field={{{ [] :cascade[<_hasItemTemplate>append<_hasCaptionField>append<_hasCaption>append[title]] }}} > - <$transclude $field=<>/> - - <> - - - + > + > + <$transclude $field=<>/> + + <> + + + +<%endif%> \end \procedure toc-newChildButton() @@ -129,7 +133,9 @@ This macro is _not_ used by other toc-macros v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter see: tf.toc-itemClass() ========================================================================================== --> \procedure toc(tag,sort:"",itemClassFilter,exclude,captionField,tagField,parentField,itemTemplate) +<$let tag={{{ [is[blank]thenelse] }}} > <$macrocall $name="toc-body" tag=<> sort=<> exclude=<>/> + \end @@ -184,7 +190,9 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter see: tf.toc-i :else[] \end -\function tf.toc-stateTitle() [[$:/state/toc]] [] "/" [] +[join[]] + +\function tf.toc-stateTitle() [[$:/state/toc]] [] "-" [] +[join[]] +\function tf.toc-closePrefix() [[$:/state/toc]] [] "/" [] +[join[]] \procedure toc-openBranch(path,currentTiddler,manual:"no") @@ -222,8 +230,9 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter see: tf.toc-i \procedure toc-closeBranch(path,currentTiddler,manual:"no") <% if [match[ctrl]] :else[match[yes]] %> - <$let prefix={{{ [] }}} > + <$let prefix={{{ [] }}} > <$action-deletetiddler $filter="[prefix]"/> + <$action-deletetiddler $filter="[prefix]"/> <% endif %> \end @@ -236,7 +245,6 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter see: tf.toc-i --> \procedure toc-item(isUnlinked:"") <% if [get[text]else[close]match[close]] %> - <$button actions=<> setTitle=<> setTo="open" class="tc-btn-invisible tc-tiny-gap-right"> <$transclude tiddler=<> /> <% if [match[yes]] %> @@ -244,7 +252,6 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter see: tf.toc-i <% endif %> <% elseif [get[text]match[open]] %> - <$button actions=<> setTitle=<> setTo="close" class="tc-btn-invisible tc-tiny-gap-right"> <$transclude tiddler=<> /> <% if [match[yes]] %> @@ -294,34 +301,36 @@ v5.3.4 itemClassFilter has been replaced by tf.toc-itemClassFilter see: tf.toc-i Shows an expandable toc. Item always have an open/close chevron =============================================================== --> \procedure toc-expandable(tag,sort:"",itemClassFilter:"",exclude,path,captionField,tagField,parentField,itemTemplate) -<$set name=currentTiddler filter="[!is[blank]thenelse]"> -
    - - <$list filter=` [subfilter] - :else[subfilter$(sort)$] - [subfilter] -[] -[subfilter]`> - <%if [] -[subfilter] %> - <$let _path=<> _mode=<> > - <$set name="_excluded" filter="[subfilter] [] [subfilter]"> - <% if [all[current]toc-link[no]] %> - <$macrocall $name="toc-unlinked-expandable-body" - tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> - captionField=<> tagField=<> parentField=<> - itemTemplate=<> - /> - <% else %> - <$macrocall $name="toc-linked-expandable-body" - tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> - captionField=<> tagField=<> parentField=<> - itemTemplate=<> - /> - <% endif %> - - - <% endif %> - -
- +<$let tag={{{ [is[blank]thenelse] }}} > + <$set name=currentTiddler filter="[!is[blank]thenelse]"> +
    + + <$list filter=` [subfilter] + :else[subfilter$(sort)$] + [subfilter] -[] -[subfilter]`> + <%if [] -[subfilter] %> + <$let _path=<> _mode=<> > + <$set name="_excluded" filter="[subfilter] [] [subfilter]"> + <% if [all[current]toc-link[no]] %> + <$macrocall $name="toc-unlinked-expandable-body" + tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> + captionField=<> tagField=<> parentField=<> + itemTemplate=<> + /> + <% else %> + <$macrocall $name="toc-linked-expandable-body" + tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> + captionField=<> tagField=<> parentField=<> + itemTemplate=<> + /> + <% endif %> + + + <% endif %> + +
+ + \end \function tf.toc-curTidInclude() [get] [get] @@ -397,34 +406,36 @@ 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,tagField,parentField,itemTemplate) -<$set name=currentTiddler filter="[!is[blank]thenelse]"> -
    - - <$list filter=` [subfilter] - :else[subfilter$(sort)$] - [subfilter] -[] -[subfilter]`> - <%if [] -[subfilter] %> - <$let _path=<> _mode=<> > - <$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>> - captionField=<> tagField=<> parentField=<> - itemTemplate=<> - /> - <% else %> - <$macrocall $name="toc-linked-selective-expandable-body" - tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> - captionField=<> tagField=<> parentField=<> - itemTemplate=<> - /> - <% endif %> - - - <% endif %> - -
- +<$let tag={{{ [is[blank]thenelse] }}} > + <$set name=currentTiddler filter="[!is[blank]thenelse]"> +
    + + <$list filter=` [subfilter] + :else[subfilter$(sort)$] + [subfilter] -[] -[subfilter]`> + <%if [] -[subfilter] %> + <$let _path=<> _mode=<> > + <$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>> + captionField=<> tagField=<> parentField=<> + itemTemplate=<> + /> + <% else %> + <$macrocall $name="toc-linked-selective-expandable-body" + tag=<> sort=<> exclude=<<_excluded>> path=<<_path>> + captionField=<> tagField=<> parentField=<> + itemTemplate=<> + /> + <% endif %> + + + <% endif %> + +
+ + \end \procedure toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"",exclude,captionField,tagField,parentField,itemTemplate) -<$tiddler tiddler={{{ [get[text]] }}}> -
- <$linkcatcher to=<>> -
- - <$macrocall $name="toc-selective-expandable" - tag=<> sort=<> exclude=<> - captionField=<> tagField=<> parentField=<> - itemTemplate=<> - /> +<$let tag={{{ [is[blank]thenelse] }}} > + <$tiddler tiddler={{{ [get[text]] }}}> +
+ <$linkcatcher to=<>> +
+ + <$macrocall $name="toc-selective-expandable" + tag=<> sort=<> exclude=<> + captionField=<> tagField=<> parentField=<> + itemTemplate=<> + /> +
+ +
+ <$reveal stateTitle=<> type="nomatch" text=""> + <$transclude mode="block" tiddler=<