@si

This is a really rough and quick attempt, there are probably simpler ways:

\define showAncestors()
<$list filter="[enlist<mylist>first[]]">
<ul><li>
<<currentTiddler>>
<$set name="mylist" filter="[enlist<mylist>rest[1]]">
<<showAncestors>>
</$set>
</li></ul>
</$list>
\end

\define getAncestors()
<$list filter="[all[current]get[parent]!is[blank]]" emptyMessage="""<$set 
name="mylist" 
filter="[enlist<mylist>reverse[]]"><<showAncestors>></$set>""">
<$log/>
    <$set name="mylist" filter="[enlist<mylist>] [<currentTiddler>]">
            <<getAncestors>>
    </$set>
</$list>
\end

<$set name="mylist" filter="[<currentTiddler>]">
<<getAncestors>>
</$set>

Apologies for the formatting, it's a bit of a struggle on a touch device.
On Wednesday, January 13, 2021 at 5:17:37 PM UTC+1 si wrote:

> I'm using Streams, where tiddlers are related hierarchically, and I'm 
> trying to create a macro that will return the ancestors of the current 
> tiddler in a formatted bullet list.
>
> So for example if I had a Stream like this:
>
>    - A
>       - B
>          - E
>          - C
>       - D
>          - F
>       
> Then the macro, when applied to tiddler F, would return this:
>
>    - A
>       - D
>          - F
>       
> I know that I can use the following kin filter to return a list of the 
> ancestors: [kin:stream-list:to:<currentTiddler>]. What I am struggling to 
> figure out is how to turn it into a list that is actually formatted as per 
> the example above.
>
> Can anyone help me out here? Thanks in advance.
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/791af96b-b458-406c-a61e-072463e3d0b5n%40googlegroups.com.

Reply via email to