TiddlyWiki5
TiddlyWiki5 copied to clipboard
generalize the tree macro to support any field
The tree macro is modified to support a field
parameter, defaulting to title for backward compatibility. As suggested in #8129, a tiddler with fields
title: /A/B/C
path1: /B/A/C
path2: /C/B/A
will be placed at different locations in the tree using the calls
<<tree prefix:"/">> // Defaults to title
<<tree prefix:"/" field:"path1">>
<<tree prefix:"/" field:"path2">>
The performance seems suboptimal compared to the original implementation, possibly due to nested looping over all tiddlers in tree_node
:
<$list filter="[all[shadows+tiddlers]get<__field__>prefix<__prefix__>removeprefix<__prefix__>splitbefore<__separator__>sort[]!suffix<__separator__>]" variable="chunk">
<$list filter="[all[shadows+tiddlers]has<__field__>sort[]] :filter[get<__field__>removeprefix<__prefix__>match<chunk>]" variable="title">
<$macrocall $name="leaf-node" prefix=<<__prefix__>> chunk=<<chunk>> title=<<title>> separator=<<__separator__>>/>
</$list>
</$list>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
tiddlywiki5 | ✅ Ready (Inspect) | Visit Preview | Apr 17, 2024 8:33pm |