From ef9878802abe72fd901b03e10b14d619d56a5bc5 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 10 Dec 2014 15:42:38 +0000 Subject: [PATCH] Transclude the caption field in toc macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- core/wiki/macros/toc.tid | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index bd13d9f34..9f3824a62 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -7,9 +7,9 @@ tags: $:/tags/Macro <$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
  • >> <$list filter="[all[current]toc-link[no]]" emptyMessage="<$link><$view field='caption'><$view field='title'/>"> -<$view field="caption"> +<$transclude field="caption"> <$view field="title"/> - + <$list filter="""[all[current]] -[[$rootTag$]]"""> <$macrocall $name="toc-body" rootTag="""$rootTag$""" tag=<> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/> @@ -39,9 +39,9 @@ tags: $:/tags/Macro {{$:/core/images/down-arrow}} -<$view field="caption"> +<$transclude field="caption"> <$view field="title"/> - + <$reveal type="match" state=<> text="open"> <$macrocall $name="toc-expandable" tag=<> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/> @@ -58,17 +58,17 @@ tags: $:/tags/Macro <$reveal type="nomatch" state=<> text="open"> <$button set=<> setTo="open" class="tc-btn-invisible"> {{$:/core/images/right-arrow}} -<$view field="caption"> +<$transclude field="caption"> <$view field="title"/> - + <$reveal type="match" state=<> text="open"> <$button set=<> setTo="close" class="tc-btn-invisible"> {{$:/core/images/down-arrow}} -<$view field="caption"> +<$transclude field="caption"> <$view field="title"/> - + <$reveal type="match" state=<> text="open"> @@ -106,9 +106,9 @@ tags: $:/tags/Macro -<$view field="caption"> +<$transclude field="caption"> <$view field="title"/> - + <$reveal type="match" state=<> text="open"> <$macrocall $name="toc-selective-expandable" tag=<> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/> @@ -126,17 +126,17 @@ tags: $:/tags/Macro <$reveal type="nomatch" state=<> text="open"> <$button set=<> setTo="open" class="tc-btn-invisible"> {{$:/core/images/right-arrow}} -<$view field="caption"> +<$transclude field="caption"> <$view field="title"/> - + <$reveal type="match" state=<> text="open"> <$button set=<> setTo="close" class="tc-btn-invisible"> {{$:/core/images/down-arrow}} -<$view field="caption"> +<$transclude field="caption"> <$view field="title"/> - + @@ -173,7 +173,7 @@ tags: $:/tags/Macro
    <$reveal state="""$selectedTiddler$""" type="nomatch" text=""> <$transclude mode="block" tiddler="$template$"> -

    <$view field="caption"><$view field="title"/>

    +

    <$transclude field="caption"><$view field="title"/>

    <$transclude mode="block">$missingText$