2014-08-18 19:52:36 +00:00
|
|
|
title: $:/core/macros/toc
|
|
|
|
tags: $:/tags/Macro
|
|
|
|
|
2014-08-20 21:48:07 +00:00
|
|
|
\define toc(tag,sort:"")
|
2014-08-31 13:05:43 +00:00
|
|
|
<ol class="tc-toc">
|
2014-08-20 21:48:07 +00:00
|
|
|
<$list filter="[tag[$tag$]$sort$]">
|
2014-08-18 19:52:36 +00:00
|
|
|
<li>
|
|
|
|
<$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-08-18 19:52:36 +00:00
|
|
|
</$link>
|
|
|
|
<$macrocall $name="toc" tag=<<currentTiddler>>/>
|
|
|
|
</li>
|
|
|
|
</$list>
|
|
|
|
</ol>
|
|
|
|
\end
|
|
|
|
|
2014-08-20 21:48:07 +00:00
|
|
|
\define toc-expandable-body(tag,sort:"")
|
2014-08-18 19:52:36 +00:00
|
|
|
<$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>>
|
|
|
|
<li>
|
|
|
|
<$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-08-20 21:48:07 +00:00
|
|
|
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="$sort$"/>
|
2014-08-18 19:52:36 +00:00
|
|
|
</$reveal>
|
|
|
|
</li>
|
|
|
|
</$set>
|
|
|
|
\end
|
|
|
|
|
2014-08-20 21:48:07 +00:00
|
|
|
\define toc-expandable(tag,sort:"")
|
2014-08-31 13:05:43 +00:00
|
|
|
<ol class="tc-toc toc-expandable">
|
2014-08-20 21:48:07 +00:00
|
|
|
<$list filter="[tag[$tag$]$sort$]">
|
|
|
|
<<toc-expandable-body tag:"$tag$" sort:"$sort$">>
|
2014-08-19 11:30:22 +00:00
|
|
|
</$list>
|
|
|
|
</ol>
|
|
|
|
\end
|
|
|
|
|
2014-08-20 21:48:07 +00:00
|
|
|
\define toc-selective-expandable-body(tag,sort:"")
|
2014-08-19 11:30:22 +00:00
|
|
|
<$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>>
|
|
|
|
<li>
|
|
|
|
<$link>
|
2014-09-01 20:27:28 +00:00
|
|
|
<$list filter="[all[current]tagging[]limit[1]]" 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-08-20 21:48:07 +00:00
|
|
|
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort="$sort$"/>
|
2014-08-19 11:30:22 +00:00
|
|
|
</$reveal>
|
|
|
|
</li>
|
|
|
|
</$set>
|
|
|
|
\end
|
|
|
|
|
2014-08-20 21:48:07 +00:00
|
|
|
\define toc-selective-expandable(tag,sort:"")
|
2014-08-31 13:05:43 +00:00
|
|
|
<ol class="tc-toc toc-selective-expandable">
|
2014-08-20 21:48:07 +00:00
|
|
|
<$list filter="[tag[$tag$]$sort$]">
|
|
|
|
<<toc-selective-expandable-body tag:"$tag$" sort:"$sort$">>
|
2014-08-18 19:52:36 +00:00
|
|
|
</$list>
|
|
|
|
</ol>
|
|
|
|
\end
|