I’ve posed a similar question before in discussions around kin filter, taggingtree, etc. I use kin:list:to[]
and kin:list:from[]
extensively in my hierarchical note-taking system. Each sub-bullet is listed in the list field of it’s parent, etc. Each date has it’s own outline like this, and already I have thousands of notes.
I’m always trying to 1. Speed things up, and 2. Replace plugins with wikitext
There were comments by Jeremy and others (Recursive filter operators to show all tiddlers beneath a tag and all tags above a tiddler - #13 by jeremyruston) that the \function
was a step in the direction of allowing the building of a recursive “tree walking”. My challenge is to try to build a \function
that replicates each of those (kin:list:from[]
and kin:list:to[]
) essentially exactly that can be invoked in the same way (inline in a filter).
If I have the luxury of knowing what the “root” tiddler is ahead of time, I can use <$wikify>
and a bunch of recursive <$list>
widgets to produce a nice ordered list that looks the same and works. In speed testing I’ve actually found it to be very slightly slower than kin:list:from[]
. That’s a trade-off I’m likely to make though to not have to rely on a (great but 3rd party) plugin that may stop working some day.
My challenge is however that I sometimes need to be able to generate and parse this list within a filter, meaning I sometimes need to generate the name of the root or note mid-filter, generate the ancestors or descendants on the fly, and filter those, then continue on. I’m also frankly just interested to know if this can be done with \function
and I’ve spent quite a few hours trying to figure it out, and I can’t seem to let it go…
Attached is a JSON with a tiddler “Macro” that contains walkthroughs of the data (hierarchical tiddlers provided: Note1 > Note1A…) and what I’ve been able to work out so far. Anyone care to take a crack at it for the challenge? Or can anyone with authority confirm that it can’t be done with \function
to put my mind at ease?
tiddlers.json (4.9 KB)