mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-31 03:14:49 +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">
|
||||
<li class=<<toc-item-class>>>
|
||||
<$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>
|
||||
</$transclude>
|
||||
</$list>
|
||||
<$list filter="""[all[current]] -[[$rootTag$]]""">
|
||||
<$macrocall $name="toc-body" rootTag="""$rootTag$""" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
||||
@ -39,9 +39,9 @@ tags: $:/tags/Macro
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$view field="caption">
|
||||
<$transclude field="caption">
|
||||
<$view field="title"/>
|
||||
</$view>
|
||||
</$transclude>
|
||||
</$link>
|
||||
<$reveal type="match" state=<<toc-state>> text="open">
|
||||
<$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">
|
||||
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible">
|
||||
{{$:/core/images/right-arrow}}
|
||||
<$view field="caption">
|
||||
<$transclude field="caption">
|
||||
<$view field="title"/>
|
||||
</$view>
|
||||
</$transclude>
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<toc-state>> text="open">
|
||||
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
|
||||
{{$:/core/images/down-arrow}}
|
||||
<$view field="caption">
|
||||
<$transclude field="caption">
|
||||
<$view field="title"/>
|
||||
</$view>
|
||||
</$transclude>
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<toc-state>> text="open">
|
||||
@ -106,9 +106,9 @@ tags: $:/tags/Macro
|
||||
</$button>
|
||||
</$reveal>
|
||||
</$list>
|
||||
<$view field="caption">
|
||||
<$transclude field="caption">
|
||||
<$view field="title"/>
|
||||
</$view>
|
||||
</$transclude>
|
||||
</$link>
|
||||
<$reveal type="match" state=<<toc-state>> text="open">
|
||||
<$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">
|
||||
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible">
|
||||
{{$:/core/images/right-arrow}}
|
||||
<$view field="caption">
|
||||
<$transclude field="caption">
|
||||
<$view field="title"/>
|
||||
</$view>
|
||||
</$transclude>
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<toc-state>> text="open">
|
||||
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
|
||||
{{$:/core/images/down-arrow}}
|
||||
<$view field="caption">
|
||||
<$transclude field="caption">
|
||||
<$view field="title"/>
|
||||
</$view>
|
||||
</$transclude>
|
||||
</$button>
|
||||
</$reveal>
|
||||
</$list>
|
||||
@ -173,7 +173,7 @@ tags: $:/tags/Macro
|
||||
<div class="tc-tabbed-table-of-contents-content">
|
||||
<$reveal state="""$selectedTiddler$""" type="nomatch" text="">
|
||||
<$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>
|
||||
</$reveal>
|
||||
|
Loading…
Reference in New Issue
Block a user