2014-08-18 19:52:36 +00:00
|
|
|
title: $:/core/macros/toc
|
|
|
|
tags: $:/tags/Macro
|
|
|
|
|
2014-11-13 21:39:28 +00:00
|
|
|
\define toc-body(rootTag,tag,sort:"",itemClassFilter)
|
2014-08-31 13:05:43 +00:00
|
|
|
<ol class="tc-toc">
|
2014-11-04 11:54:35 +00:00
|
|
|
<$list filter="""[tag[$tag$]!has[draft.of]$sort$]""">
|
2014-11-13 21:39:28 +00:00
|
|
|
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
|
|
|
|
<li class=<<toc-item-class>>>
|
2014-09-05 08:49:10 +00:00
|
|
|
<$list filter="[is[current]toc-link[no]]" emptyMessage="<$link><$view field='caption'><$view field='title'/></$view></$link>">
|
2014-08-28 07:58:53 +00:00
|
|
|
<$view field="caption">
|
2014-08-18 19:52:36 +00:00
|
|
|
<$view field="title"/>
|
2014-08-28 07:58:53 +00:00
|
|
|
</$view>
|
2014-09-05 08:49:10 +00:00
|
|
|
</$list>
|
2014-11-02 21:03:27 +00:00
|
|
|
<$list filter="""[all[current]] -[[$rootTag$]]""">
|
2014-11-13 21:39:28 +00:00
|
|
|
<$macrocall $name="toc-body" rootTag="""$rootTag$""" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
2014-11-02 21:03:27 +00:00
|
|
|
</$list>
|
2014-08-18 19:52:36 +00:00
|
|
|
</li>
|
2014-11-13 21:39:28 +00:00
|
|
|
</$set>
|
2014-08-18 19:52:36 +00:00
|
|
|
</$list>
|
|
|
|
</ol>
|
|
|
|
\end
|
|
|
|
|
2014-11-13 21:39:28 +00:00
|
|
|
\define toc(tag,sort:"",itemClassFilter)
|
|
|
|
<<toc-body rootTag:"""$tag$""" tag:"""$tag$""" sort:"""$sort$""" itemClassFilter:"""itemClassFilter""">>
|
2014-11-02 21:03:27 +00:00
|
|
|
\end
|
|
|
|
|
2014-11-13 21:39:28 +00:00
|
|
|
\define toc-linked-expandable-body(tag,sort:"",itemClassFilter)
|
2014-08-18 19:52:36 +00:00
|
|
|
<$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>>
|
2014-11-13 21:39:28 +00:00
|
|
|
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
|
|
|
|
<li class=<<toc-item-class>>>
|
2014-08-18 19:52:36 +00:00
|
|
|
<$link>
|
|
|
|
<$reveal type="nomatch" state=<<toc-state>> text="open">
|
2014-08-28 16:28:32 +00:00
|
|
|
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible">
|
2014-08-18 19:52:36 +00:00
|
|
|
{{$:/core/images/right-arrow}}
|
|
|
|
</$button>
|
|
|
|
</$reveal>
|
|
|
|
<$reveal type="match" state=<<toc-state>> text="open">
|
2014-08-28 16:28:32 +00:00
|
|
|
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
|
2014-08-18 19:52:36 +00:00
|
|
|
{{$:/core/images/down-arrow}}
|
|
|
|
</$button>
|
|
|
|
</$reveal>
|
2014-08-28 07:58:53 +00:00
|
|
|
<$view field="caption">
|
2014-08-18 19:52:36 +00:00
|
|
|
<$view field="title"/>
|
2014-08-28 07:58:53 +00:00
|
|
|
</$view>
|
2014-08-18 19:52:36 +00:00
|
|
|
</$link>
|
|
|
|
<$reveal type="match" state=<<toc-state>> text="open">
|
2014-11-13 21:39:28 +00:00
|
|
|
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
2014-08-18 19:52:36 +00:00
|
|
|
</$reveal>
|
|
|
|
</li>
|
|
|
|
</$set>
|
2014-11-13 21:39:28 +00:00
|
|
|
</$set>
|
2014-08-18 19:52:36 +00:00
|
|
|
\end
|
|
|
|
|
2014-11-13 21:39:28 +00:00
|
|
|
\define toc-unlinked-expandable-body(tag,sort:"",itemClassFilter)
|
2014-09-05 08:49:10 +00:00
|
|
|
<$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>>
|
2014-11-13 21:39:28 +00:00
|
|
|
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
|
|
|
|
<li class=<<toc-item-class>>>
|
2014-09-05 08:49:10 +00:00
|
|
|
<$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">
|
|
|
|
<$view field="title"/>
|
|
|
|
</$view>
|
|
|
|
</$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">
|
|
|
|
<$view field="title"/>
|
|
|
|
</$view>
|
|
|
|
</$button>
|
|
|
|
</$reveal>
|
|
|
|
<$reveal type="match" state=<<toc-state>> text="open">
|
2014-11-13 21:39:28 +00:00
|
|
|
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
2014-09-05 08:49:10 +00:00
|
|
|
</$reveal>
|
|
|
|
</li>
|
|
|
|
</$set>
|
2014-11-13 21:39:28 +00:00
|
|
|
</$set>
|
2014-09-05 08:49:10 +00:00
|
|
|
\end
|
|
|
|
|
2014-11-13 21:39:28 +00:00
|
|
|
\define toc-expandable(tag,sort:"",itemClassFilter)
|
2014-08-31 13:05:43 +00:00
|
|
|
<ol class="tc-toc toc-expandable">
|
2014-11-04 11:54:35 +00:00
|
|
|
<$list filter="[tag[$tag$]!has[draft.of]$sort$]">
|
2014-11-13 21:39:28 +00:00
|
|
|
<$list filter="[is[current]toc-link[no]]" emptyMessage="<<toc-linked-expandable-body tag:'$tag$' sort:'$sort$' itemClassFilter:'$itemClassFilter$'>>">
|
|
|
|
<<toc-unlinked-expandable-body tag:"""$tag$""" sort:"""$sort$""" itemClassFilter:"""itemClassFilter""">>
|
2014-09-05 08:49:10 +00:00
|
|
|
</$list>
|
2014-08-19 11:30:22 +00:00
|
|
|
</$list>
|
|
|
|
</ol>
|
|
|
|
\end
|
|
|
|
|
2014-11-13 21:39:28 +00:00
|
|
|
\define toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter)
|
2014-08-19 11:30:22 +00:00
|
|
|
<$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>>
|
2014-11-13 21:39:28 +00:00
|
|
|
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
|
|
|
|
<li class=<<toc-item-class>>>
|
2014-08-19 11:30:22 +00:00
|
|
|
<$link>
|
2014-09-10 20:55:11 +00:00
|
|
|
<$list filter="[all[current]tagging[]limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button>">
|
2014-08-19 11:30:22 +00:00
|
|
|
<$reveal type="nomatch" state=<<toc-state>> text="open">
|
2014-08-28 16:28:32 +00:00
|
|
|
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible">
|
2014-08-19 11:30:22 +00:00
|
|
|
{{$:/core/images/right-arrow}}
|
|
|
|
</$button>
|
|
|
|
</$reveal>
|
|
|
|
<$reveal type="match" state=<<toc-state>> text="open">
|
2014-08-28 16:28:32 +00:00
|
|
|
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
|
2014-08-19 11:30:22 +00:00
|
|
|
{{$:/core/images/down-arrow}}
|
|
|
|
</$button>
|
|
|
|
</$reveal>
|
|
|
|
</$list>
|
2014-08-28 07:58:53 +00:00
|
|
|
<$view field="caption">
|
2014-08-19 11:30:22 +00:00
|
|
|
<$view field="title"/>
|
2014-08-28 07:58:53 +00:00
|
|
|
</$view>
|
2014-08-19 11:30:22 +00:00
|
|
|
</$link>
|
|
|
|
<$reveal type="match" state=<<toc-state>> text="open">
|
2014-11-13 21:39:28 +00:00
|
|
|
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
2014-08-19 11:30:22 +00:00
|
|
|
</$reveal>
|
|
|
|
</li>
|
|
|
|
</$set>
|
2014-11-13 21:39:28 +00:00
|
|
|
</$set>
|
2014-08-19 11:30:22 +00:00
|
|
|
\end
|
|
|
|
|
2014-11-13 21:39:28 +00:00
|
|
|
\define toc-unlinked-selective-expandable-body(tag,sort:"",itemClassFilter)
|
2014-09-05 08:49:10 +00:00
|
|
|
<$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>>
|
2014-11-13 21:39:28 +00:00
|
|
|
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
|
|
|
|
<li class=<<toc-item-class>>>
|
2014-09-10 20:55:11 +00:00
|
|
|
<$list filter="[all[current]tagging[]limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button> <$view field='caption'><$view field='title'/></$view>">
|
2014-09-05 08:49:10 +00:00
|
|
|
<$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">
|
|
|
|
<$view field="title"/>
|
|
|
|
</$view>
|
|
|
|
</$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">
|
|
|
|
<$view field="title"/>
|
|
|
|
</$view>
|
|
|
|
</$button>
|
|
|
|
</$reveal>
|
|
|
|
</$list>
|
|
|
|
<$reveal type="match" state=<<toc-state>> text="open">
|
2014-11-13 21:39:28 +00:00
|
|
|
<$macrocall $name="""toc-selective-expandable""" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
|
2014-09-05 08:49:10 +00:00
|
|
|
</$reveal>
|
|
|
|
</li>
|
|
|
|
</$set>
|
2014-11-13 21:39:28 +00:00
|
|
|
</$set>
|
2014-09-05 08:49:10 +00:00
|
|
|
\end
|
|
|
|
|
2014-11-13 21:39:28 +00:00
|
|
|
\define toc-selective-expandable(tag,sort:"",itemClassFilter)
|
2014-08-31 13:05:43 +00:00
|
|
|
<ol class="tc-toc toc-selective-expandable">
|
2014-11-04 11:54:35 +00:00
|
|
|
<$list filter="[tag[$tag$]!has[draft.of]$sort$]">
|
2014-11-13 21:39:28 +00:00
|
|
|
<$list filter="[is[current]toc-link[no]]" variable="ignore" emptyMessage="<<toc-linked-selective-expandable-body tag:'$tag$' sort:'$sort$' itemClassFilter:'$itemClassFilter$'>>">
|
|
|
|
<<toc-unlinked-selective-expandable-body tag:"""$tag$""" sort:"""$sort$""" itemClassFilter:"""$itemClassFilter$""">>
|
2014-09-05 08:49:10 +00:00
|
|
|
</$list>
|
2014-08-18 19:52:36 +00:00
|
|
|
</$list>
|
|
|
|
</ol>
|
|
|
|
\end
|
2014-11-13 21:39:28 +00:00
|
|
|
|
|
|
|
\define toc-tabbed-selected-item-filter(selectedTiddler)
|
|
|
|
[all[current]field:title{$selectedTiddler$}]
|
|
|
|
\end
|
|
|
|
|
2014-12-02 23:47:23 +00:00
|
|
|
\define toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"")
|
2014-11-13 21:39:28 +00:00
|
|
|
<$tiddler tiddler={{$selectedTiddler$}}>
|
|
|
|
<div class="tc-tabbed-table-of-contents">
|
2014-11-14 17:06:21 +00:00
|
|
|
<$linkcatcher to="$selectedTiddler$">
|
2014-11-13 21:39:28 +00:00
|
|
|
<div class="tc-table-of-contents">
|
|
|
|
<$macrocall $name="toc-selective-expandable" tag="""$tag$""" sort="""$sort$""" itemClassFilter=<<toc-tabbed-selected-item-filter selectedTiddler:"""$selectedTiddler$""">>/>
|
|
|
|
</div>
|
2014-11-14 17:06:21 +00:00
|
|
|
</$linkcatcher>
|
2014-11-13 21:39:28 +00:00
|
|
|
<div class="tc-tabbed-table-of-contents-content">
|
2014-12-02 23:47:23 +00:00
|
|
|
<$reveal state="""$selectedTiddler$""" type="nomatch" text="">
|
2014-12-02 23:05:54 +00:00
|
|
|
<$transclude mode="block" tiddler="$template$">
|
2014-11-13 21:39:28 +00:00
|
|
|
<h1><$view field="caption"><$view field="title"/></$view></h1>
|
2014-12-02 23:47:23 +00:00
|
|
|
<$transclude mode="block">$missingText$</$transclude>
|
2014-12-02 23:05:54 +00:00
|
|
|
</$transclude>
|
2014-12-02 23:47:23 +00:00
|
|
|
</$reveal>
|
|
|
|
<$reveal state="""$selectedTiddler$""" type="match" text="">
|
|
|
|
$unselectedText$
|
|
|
|
</$reveal>
|
2014-11-13 21:39:28 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</$tiddler>
|
2014-11-14 17:06:21 +00:00
|
|
|
\end
|
|
|
|
|
2014-12-02 23:47:23 +00:00
|
|
|
\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"")
|
2014-11-14 17:06:21 +00:00
|
|
|
<$linkcatcher to="""$selectedTiddler$""">
|
2014-12-02 23:47:23 +00:00
|
|
|
<$macrocall $name="toc-tabbed-external-nav" tag="""$tag$""" sort="""$sort$""" selectedTiddler="""$selectedTiddler$""" unselectedText="""$unselectedText$""" missingText="""$missingText$""" template="""$template$"""/>
|
2014-11-13 21:39:28 +00:00
|
|
|
</$linkcatcher>
|
|
|
|
\end
|
2014-11-14 17:06:21 +00:00
|
|
|
|