mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-07 14:40:02 +00:00
Transclude the caption field in toc macro
For consistency with the way that tabs work. To see this in action, on tiddlywiki.com open the tiddler `$:/tags/ControlPanel` and edit it to add the tag “TableOfContents”. You’ll see the control panel appear at the bottom of the table of contents.
This commit is contained in:
parent
31b5eb1578
commit
ef9878802a
@ -7,9 +7,9 @@ tags: $:/tags/Macro
|
|||||||
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
|
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
|
||||||
<li class=<<toc-item-class>>>
|
<li class=<<toc-item-class>>>
|
||||||
<$list filter="[all[current]toc-link[no]]" emptyMessage="<$link><$view field='caption'><$view field='title'/></$view></$link>">
|
<$list filter="[all[current]toc-link[no]]" emptyMessage="<$link><$view field='caption'><$view field='title'/></$view></$link>">
|
||||||
<$view field="caption">
|
<$transclude field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
</$view>
|
</$transclude>
|
||||||
</$list>
|
</$list>
|
||||||
<$list filter="""[all[current]] -[[$rootTag$]]""">
|
<$list filter="""[all[current]] -[[$rootTag$]]""">
|
||||||
<$macrocall $name="toc-body" rootTag="""$rootTag$""" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
<$macrocall $name="toc-body" rootTag="""$rootTag$""" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
||||||
@ -39,9 +39,9 @@ tags: $:/tags/Macro
|
|||||||
{{$:/core/images/down-arrow}}
|
{{$:/core/images/down-arrow}}
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$view field="caption">
|
<$transclude field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
</$view>
|
</$transclude>
|
||||||
</$link>
|
</$link>
|
||||||
<$reveal type="match" state=<<toc-state>> text="open">
|
<$reveal type="match" state=<<toc-state>> text="open">
|
||||||
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
||||||
@ -58,17 +58,17 @@ tags: $:/tags/Macro
|
|||||||
<$reveal type="nomatch" state=<<toc-state>> text="open">
|
<$reveal type="nomatch" state=<<toc-state>> text="open">
|
||||||
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible">
|
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible">
|
||||||
{{$:/core/images/right-arrow}}
|
{{$:/core/images/right-arrow}}
|
||||||
<$view field="caption">
|
<$transclude field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
</$view>
|
</$transclude>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$reveal type="match" state=<<toc-state>> text="open">
|
<$reveal type="match" state=<<toc-state>> text="open">
|
||||||
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
|
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
|
||||||
{{$:/core/images/down-arrow}}
|
{{$:/core/images/down-arrow}}
|
||||||
<$view field="caption">
|
<$transclude field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
</$view>
|
</$transclude>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$reveal type="match" state=<<toc-state>> text="open">
|
<$reveal type="match" state=<<toc-state>> text="open">
|
||||||
@ -106,9 +106,9 @@ tags: $:/tags/Macro
|
|||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
</$list>
|
</$list>
|
||||||
<$view field="caption">
|
<$transclude field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
</$view>
|
</$transclude>
|
||||||
</$link>
|
</$link>
|
||||||
<$reveal type="match" state=<<toc-state>> text="open">
|
<$reveal type="match" state=<<toc-state>> text="open">
|
||||||
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
||||||
@ -126,17 +126,17 @@ tags: $:/tags/Macro
|
|||||||
<$reveal type="nomatch" state=<<toc-state>> text="open">
|
<$reveal type="nomatch" state=<<toc-state>> text="open">
|
||||||
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible">
|
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible">
|
||||||
{{$:/core/images/right-arrow}}
|
{{$:/core/images/right-arrow}}
|
||||||
<$view field="caption">
|
<$transclude field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
</$view>
|
</$transclude>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$reveal type="match" state=<<toc-state>> text="open">
|
<$reveal type="match" state=<<toc-state>> text="open">
|
||||||
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
|
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
|
||||||
{{$:/core/images/down-arrow}}
|
{{$:/core/images/down-arrow}}
|
||||||
<$view field="caption">
|
<$transclude field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
</$view>
|
</$transclude>
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
</$list>
|
</$list>
|
||||||
@ -173,7 +173,7 @@ tags: $:/tags/Macro
|
|||||||
<div class="tc-tabbed-table-of-contents-content">
|
<div class="tc-tabbed-table-of-contents-content">
|
||||||
<$reveal state="""$selectedTiddler$""" type="nomatch" text="">
|
<$reveal state="""$selectedTiddler$""" type="nomatch" text="">
|
||||||
<$transclude mode="block" tiddler="$template$">
|
<$transclude mode="block" tiddler="$template$">
|
||||||
<h1><$view field="caption"><$view field="title"/></$view></h1>
|
<h1><$transclude field="caption"><$view field="title"/></$transclude></h1>
|
||||||
<$transclude mode="block">$missingText$</$transclude>
|
<$transclude mode="block">$missingText$</$transclude>
|
||||||
</$transclude>
|
</$transclude>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user