mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Disable links when transcluding caption field in toc macro
@BramChen does this work for you?
This commit is contained in:
parent
51db48acc9
commit
5b38c21a41
@ -1,15 +1,21 @@
|
|||||||
title: $:/core/macros/toc
|
title: $:/core/macros/toc
|
||||||
tags: $:/tags/Macro
|
tags: $:/tags/Macro
|
||||||
|
|
||||||
|
\define toc-caption()
|
||||||
|
<$set name="tv-wikilinks" value="no">
|
||||||
|
<$transclude field="caption">
|
||||||
|
<$view field="title"/>
|
||||||
|
</$transclude>
|
||||||
|
</$set>
|
||||||
|
\end
|
||||||
|
|
||||||
\define toc-body(rootTag,tag,sort:"",itemClassFilter)
|
\define toc-body(rootTag,tag,sort:"",itemClassFilter)
|
||||||
<ol class="tc-toc">
|
<ol class="tc-toc">
|
||||||
<$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$]""">
|
<$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$]""">
|
||||||
<$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>">
|
||||||
<$transclude field="caption">
|
<<toc-caption>>
|
||||||
<$view field="title"/>
|
|
||||||
</$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 +45,7 @@ tags: $:/tags/Macro
|
|||||||
{{$:/core/images/down-arrow}}
|
{{$:/core/images/down-arrow}}
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$transclude field="caption">
|
<<toc-caption>>
|
||||||
<$view field="title"/>
|
|
||||||
</$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 +62,13 @@ 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}}
|
||||||
<$transclude field="caption">
|
<<toc-caption>>
|
||||||
<$view field="title"/>
|
|
||||||
</$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}}
|
||||||
<$transclude field="caption">
|
<<toc-caption>>
|
||||||
<$view field="title"/>
|
|
||||||
</$transclude>
|
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$reveal type="match" state=<<toc-state>> text="open">
|
<$reveal type="match" state=<<toc-state>> text="open">
|
||||||
@ -106,9 +106,7 @@ tags: $:/tags/Macro
|
|||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
</$list>
|
</$list>
|
||||||
<$transclude field="caption">
|
<<toc-caption>>
|
||||||
<$view field="title"/>
|
|
||||||
</$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 +124,13 @@ 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}}
|
||||||
<$transclude field="caption">
|
<<toc-caption>>
|
||||||
<$view field="title"/>
|
|
||||||
</$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}}
|
||||||
<$transclude field="caption">
|
<<toc-caption>>
|
||||||
<$view field="title"/>
|
|
||||||
</$transclude>
|
|
||||||
</$button>
|
</$button>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
</$list>
|
</$list>
|
||||||
|
Loading…
Reference in New Issue
Block a user