Hello
I have written the below functions to recursively generate a tree of tiddlers descended from a single tag, on the condition that each of them also has a field parent_tag
which contains the title of the tiddler directly above it in the hierarchy.
\function tag.tree()
[all[]]
:map:flat[tagging[]field:parent_tag<currentTiddler>]
+[!is[blank]]
:map:flat[function[tag.tree.include.self]]
\end
\function tag.tree.include.self()
[all[]]
[function[tag.tree]]
\end
Is there any way to optimise or neaten this up, ideally to be contained within a single function? I have thought about it for a while, but I think I need the second filter expression to make sure that each subsequent call to the first function also returns the tiddler that triggered the call…
Any suggestions would be appreciated!