OcttKB/Wiki-OcttKB/tiddlers/System/Macros/_TiddlerTree.tid

38 lines
1.6 KiB
Plaintext
Raw Normal View History

2023-06-11 22:14:59 +02:00
created: 20230301190809321
creator: Octt
modified: 20230301211845785
modifier: Octt
tags: $:/tags/Macro
title: $:/Macros/TiddlerTree
<!-- Most of the code derived from:
- $:/core/macros/toc
-->
\define tiddlertree(tag,sort:"",itemClassFilter,exclude,path)
\whitespace trim
<div class="tc-table-of-contents">
<$let tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>
<$set name="excluded" filter="[enlist<__exclude__>] [<__tag__>]">
<$set name="FolderPath" value=<<StrAppend "$tag$" "/">> >
<ol class="tc-toc toc-selective-expandable">
<<tree_ "$tag$/" show-title:"false">>
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[enlist<__exclude__>]""">
<$list filter="[all[current]toc-link[no]]" variable="ignore" emptyMessage=<<toc-selective-expandable-empty-message>> >
<$macrocall $name="toc-unlinked-selective-expandable-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>>/>
</$list>
</$list>
<!--
<$list filter="""[all[shadows+tiddlers]prefix<FolderPath>] -[<__tag__>] -[enlist<__exclude__>]""">
<$list filter="[all[current]toc-link[no]]" variable="ignore" emptyMessage=<<toc-selective-expandable-empty-message>> >
<$macrocall $name="tiddlertree-unlinked-selective-expandable-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>>/>
</$list>
</$list>
-->
</ol>
</$set>
</$set>
</$let>
</div>
\end