recursing without repeating

31 views
Skip to first unread message

Rustem

unread,
Apr 16, 2015, 1:27:44 PM4/16/15
to tiddl...@googlegroups.com
(edit:fixed typo in subject)

How can I build a tree that only shows each node once?

Using the code below, if a tiddler is tagged with any of it's parent's tags, it will apeear multiple times in the tree. I'd like it to appear at the uppermost level only, once.
```
\define tree(tiddler)
;[[$tiddler$]]
:<$transclude tiddler="My Project" mode=block/>
\end
<$list filter="[<currentTiddler>tagging[]]">

  <$macrocall $name=tree tiddler={{!!title}}/>

</$list>
```
I'm thinking I need another macro that will build up the list filter, adding !title for each tiddler encountered. Is it possible?






Jed Carty

unread,
Apr 16, 2015, 2:04:20 PM4/16/15
to tiddl...@googlegroups.com
Depending on some other details, you may have to use javascript. I have run into this a few times. It is the reason that seach by field contents doesn't work correctly here. Since it is a project I am working on I will hopefully make a fix for it at some point, but that may take a long time.

If you are lucky changing the filter to
[<currentTiddler>tagging[]unique[]]
may work, but it doesn't sound like that will be enough in your situation.
Reply all
Reply to author
Forward
0 new messages