title: $:/core/macros/tree tags: $:/tags/Macro \define leaf-node(prefix)
  • <$list filter="""[[$prefix$$(chunk)$]is[shadow]] [[$prefix$$(chunk)$]is[tiddler]] +[removeprefix[$prefix$]] +[limit[1]]""" emptyMessage="""<$text text="$prefix$$(chunk)$"/>"""> {{$:/core/images/file}} <$link to="""$prefix$$(chunk)$"""> <$view field="title"/>
  • \end \define branch-node(prefix) <$reveal type="nomatch" text="" default="""$(chunk)$""">
  • <$list filter="""[all[shadows+tiddlers]prefix[$prefix$$(chunk)$]] -[[$prefix$$(chunk)$]] +[limit[1]]"""> <$reveal type="nomatch" state="""$:/state/tree/$prefix$$(chunk)$""" text="show"> <$button set="""$:/state/tree/$prefix$$(chunk)$""" setTo="show" class="tc-btn-invisible">{{$:/core/images/folder}} <$text text="""$(chunk)$"""/> <$reveal type="match" state="""$:/state/tree/$prefix$$(chunk)$""" text="show"> <$button set="""$:/state/tree/$prefix$$(chunk)$""" setTo="hide" class="tc-btn-invisible">{{$:/core/images/folder}} <$text text="""$(chunk)$"""/> <$list filter="""[all[shadows+tiddlers]prefix[$prefix$$(chunk)$]] -[[$prefix$$(chunk)$]] +[limit[1]]""">(<$count filter="""[all[shadows+tiddlers]prefix[$prefix$$(chunk)$]] -[[$prefix$$(chunk)$]]"""/>) <$reveal type="match" state="""$:/state/tree/$prefix$$(chunk)$""" text="show"> <$macrocall $name="tree-node" prefix="""$prefix$$(chunk)$"""/>
  • \end \define tree-node(prefix)
      <$list filter="[all[shadows+tiddlers]removeprefix[$prefix$]splitbefore[/]sort[title]] +[!suffix[/]]" variable="chunk"> <> <$list filter="[all[shadows+tiddlers]removeprefix[$prefix$]splitbefore[/]sort[title]] +[suffix[/]]" variable="chunk"> <>
    \end \define tree(prefix)
    <$text text="""$prefix$"""/>
    <$macrocall $name="tree-node" prefix="""$prefix$"""/>
    \end