mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-25 01:20:30 +00:00
Extend TOC macros to use caption field
Now the `caption` field is used for the text of each entry, if present, falling back to the `title` field.
This commit is contained in:
parent
8ca709f664
commit
d2a5a12f2d
@ -6,7 +6,9 @@ tags: $:/tags/Macro
|
|||||||
<$list filter="[tag[$tag$]$sort$]">
|
<$list filter="[tag[$tag$]$sort$]">
|
||||||
<li>
|
<li>
|
||||||
<$link>
|
<$link>
|
||||||
|
<$view field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
|
</$view>
|
||||||
</$link>
|
</$link>
|
||||||
<$macrocall $name="toc" tag=<<currentTiddler>>/>
|
<$macrocall $name="toc" tag=<<currentTiddler>>/>
|
||||||
</li>
|
</li>
|
||||||
@ -28,7 +30,9 @@ tags: $:/tags/Macro
|
|||||||
{{$:/core/images/down-arrow}}
|
{{$:/core/images/down-arrow}}
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
|
<$view field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
|
</$view>
|
||||||
</$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$"/>
|
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="$sort$"/>
|
||||||
@ -61,7 +65,9 @@ tags: $:/tags/Macro
|
|||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
</$list>
|
</$list>
|
||||||
|
<$view field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
|
</$view>
|
||||||
</$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$"/>
|
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort="$sort$"/>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
title: TableOfContentsMacro
|
title: TableOfContentsMacro
|
||||||
tags: macros
|
tags: macros
|
||||||
modified: 20140818180307785
|
modified: 20140828080307785
|
||||||
|
|
||||||
The table of contents macro produces a hierarchical tree of tiddlers based on their tags.
|
The table of contents macro produces a hierarchical tree of tiddlers based on their tags.
|
||||||
|
|
||||||
The top level entries of the table of contents are defined by a root tag. The subentries under each of those entries are tagged with the title of the entry. Entries can be ordered using the `list` field as described in TiddlerTags.
|
The top level entries of the table of contents are defined by a root tag. The subentries under each of those entries are tagged with the title of the entry. Entries can be ordered using the `list` field as described in TiddlerTags. The text for each entry is taken from the ''caption'' field if it is present, otherwise the ''title'' is used.
|
||||||
|
|
||||||
There are several variants of the macro:
|
There are several variants of the macro:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user