title: $:/core/macros/toc
tags: $:/tags/Macro
\define toc(tag)
<$list filter="[tag[$tag$]]">
-
<$link>
<$view field="title"/>
$link>
<$macrocall $name="toc" tag=<>/>
$list>
\end
\define toc-expandable-body(tag,show-button-filter)
<$set name="toc-state" value=<>>
<$link>
<$reveal type="nomatch" state=<> text="open">
<$button set=<> setTo="open" class="btn-invisible">
{{$:/core/images/right-arrow}}
$button>
$reveal>
<$reveal type="match" state=<> text="open">
<$button set=<> setTo="close" class="btn-invisible">
{{$:/core/images/down-arrow}}
$button>
$reveal>
<$view field="title"/>
$link>
<$reveal type="match" state=<> text="open">
<$macrocall $name="toc-expandable" tag=<>/>
$reveal>
$set>
\end
\define toc-expandable(tag)
<$list filter="[tag[$tag$]]">
<>
$list>
\end
\define toc-selective-expandable-body(tag,show-button-filter)
<$set name="toc-state" value=<>>
<$link>
<$list filter="[all[current]tagging[]limit[1]]">
<$reveal type="nomatch" state=<> text="open">
<$button set=<> setTo="open" class="btn-invisible">
{{$:/core/images/right-arrow}}
$button>
$reveal>
<$reveal type="match" state=<> text="open">
<$button set=<> setTo="close" class="btn-invisible">
{{$:/core/images/down-arrow}}
$button>
$reveal>
$list>
<$view field="title"/>
$link>
<$reveal type="match" state=<> text="open">
<$macrocall $name="toc-selective-expandable" tag=<>/>
$reveal>
$set>
\end
\define toc-selective-expandable(tag)
<$list filter="[tag[$tag$]]">
<>
$list>
\end