title: $:/core/macros/tree tags: $:/tags/Macro \procedure leaf-link(full-title,chunk,separator: "/") <$link to=<>><$text text=<>/> \end \whitespace trim \procedure leaf-node(prefix,chunk)
  • <$list filter="[addsuffixis[shadow]] [addsuffixis[tiddler]]" variable="full-title"> <$list filter="[removeprefix]" variable="chunk"> {{$:/core/images/file}}<$transclude $variable="leaf-link" full-title=<> chunk=<>/>
  • \end \procedure branch-node(prefix,chunk,separator: "/")
  • <$set name="reveal-state" value={{{ [[$:/state/tree/]addsuffixaddsuffix] }}}> <$reveal type="nomatch" stateTitle=<> text="show"> <$button setTitle=<> setTo="show" class="tc-btn-invisible"> {{$:/core/images/folder}} <$text text=<>/> <$reveal type="match" stateTitle=<> text="show"> <$button setTitle=<> setTo="hide" class="tc-btn-invisible"> {{$:/core/images/folder}} <$text text=<>/> (<$count filter="[all[shadows+tiddlers]removeprefixremoveprefix] -[addsuffix]"/>) <$reveal type="match" stateTitle=<> text="show"> <$transclude $variable="tree-node" prefix={{{ [addsuffix] }}} separator=<>/>
  • \end \procedure tree-node(prefix,separator: "/")
      <$list filter="[all[shadows+tiddlers]removeprefixsplitbeforesort[]!suffix]" variable="chunk"> <$transclude $variable="leaf-node" prefix=<> chunk=<> separator=<>/> <$list filter="[all[shadows+tiddlers]removeprefixsplitbeforesort[]suffix]" variable="chunk"> <$transclude $variable="branch-node" prefix=<> chunk=<> separator=<>/>
    \end \procedure tree(prefix: "$:/",separator: "/")
    <$text text=<>/>
    <$transclude $variable="tree-node" prefix=<> separator=<>/>
    \end