mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-03-28 14:26:56 +00:00
parent
835e3a9452
commit
3d7b40fbaa
@ -1,21 +1,31 @@
|
||||
title: $:/core/macros/toc
|
||||
tags: $:/tags/Macro
|
||||
|
||||
\define toc(tag,sort:"")
|
||||
\define toc-body(rootTag,tag,sort:"")
|
||||
<ol class="tc-toc">
|
||||
<$list filter="[tag[$tag$]$sort$]">
|
||||
<$list filter="""[tag[$tag$]$sort$]""">
|
||||
<li>
|
||||
<$list filter="[is[current]toc-link[no]]" emptyMessage="<$link><$view field='caption'><$view field='title'/></$view></$link>">
|
||||
<$view field="caption">
|
||||
<$view field="title"/>
|
||||
</$view>
|
||||
</$list>
|
||||
<$macrocall $name="toc" tag=<<currentTiddler>> sort="$sort$"/>
|
||||
|
||||
<$list filter="""[all[current]] -[[$rootTag$]]""">
|
||||
|
||||
<$macrocall $name="toc-body" rootTag="""$rootTag$""" tag=<<currentTiddler>> sort="$sort$"/>
|
||||
|
||||
</$list>
|
||||
|
||||
</li>
|
||||
</$list>
|
||||
</ol>
|
||||
\end
|
||||
|
||||
\define toc(tag,sort:"")
|
||||
<<toc-body rootTag:"""$tag$""" tag:"""$tag$""" sort:"""$sort$""">>
|
||||
\end
|
||||
|
||||
\define toc-linked-expandable-body(tag,sort:"")
|
||||
<$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>>
|
||||
<li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user