Hi,
I'm resurrecting this thread again because other threads suggest that
wikify-then-enlist is the solution, but I can't seem to get it to work. I'm
using the list field to manage a hierarchy; the descendants are in the list
field.
\define wrap(text,left:"[[",right:"]]") $left$$text$$right$
\define list-descendants(parent,list:"list")
<$tiddler tiddler="""$parent$""">
<$list filter="""[all[current]has[$list$]$list$[]] -[all[current]]"""
variable="child">
<$macrocall $name="wrap"
text=<<child>>/>
<!--
<$link to=<<child>>/>
-->
<$macrocall $name="list-descendants"
parent=<<child>>
list="$list$"/>
</$list>
</$tiddler>
\end
\define descendants() <<list-descendants parent:"A">>
\define list-descendant-terms()
<$wikify text=<<descendants>> name="wikifiedDescendants">
<$list filter="[enlist<wikifiedDescendants>]"/>
</$wikify>
\end
My test tiddlers are:
title: A
list: [[A 1]] [[A 2]]
title: A 1
list: [[A 1 i]] [[A 1 ii]]
title: A 2
list: [[A 2 i]]
title: A 1 i
title: A 1 ii
title: A 2 i
The wrap, list-descendants, and descendants macros work, but feeding their
output into a filter in list-descendant-terms yields A1iii2, where A is a
link to tiddler A.
Any help with this would be appreciated. Thanks!
Mike
On Saturday, September 29, 2018 at 3:35:52 PM UTC-4, LorenzGL wrote:
>
> I'm resurrecting this thread because I'm stuck trying to feed the output
> of a recursive macro into a filter using wikify. The problem seems to be
> that the macro is outputting a formatted list but the filter expects a
> title list. I haven't been able to figure out how to solve the problem. The
> goal is to display a list of all individuals of a superclass for
> individuals that are only linked to subclasses but not the superclass. Here
> is my code:
>
> \define class_sub()
> <$list filter="[is_subclass_of{!!title}]">
> <$link><<currentTiddler>></$link>
> <$macrocall $name="class_sub">>
> </$list>
> \end
>
> <$wikify name="all_subclasses" text=<<class_sub>> output=html>
> <<list-links filter:"[enlist<all_subclasses>listed[is_individual_of]]">>
> </$wikify>
>
> Any help on this would be greatly appreciated.
>
> On Thursday, May 5, 2016 at 5:59:29 PM UTC-7, Majid al-Dosari wrote:
>>
>> these kinds of things are now pretty much solved with the wikify widget
>> https://github.com/Jermolene/TiddlyWiki5/issues/2337
>>
>> I fired up my tw from source and i now can construct recursive macros to
>> generate filters and then have their output (through a wikify) go in a
>> filter attribute of whatever widget that uses it.
>>
>>
>> On Wednesday, September 9, 2015 at 3:57:31 PM UTC-4, Linus Johnsson wrote:
>>>
>>> Dear all,
>>>
>>> I am working on a project in which I need to be able to get a list of a
>>> tiddler's descendants. I use tags to define the relationship in question.
>>> To be precise, B is a descendant of A if A=B or B is tagged with a
>>> descendant of A.
>>>
>>> The list should be equal to what you get if you evaluate a filter that
>>> goes something like this:
>>>
>>> [all[current]tag[concept]] [all[current]tag[concept]tagging[]tag[concept
>>> ]] [all[current]tag[concept]tagging[]tag[concept]tagging[]tag[concept]]
>>> ...
>>>
>>> The problem is of course that my current solution does not allow for
>>> arbitrary depth of search, which is what I want.
>>>
>>> I have been trying to wrap my head around this problem and still can't
>>> judge whether or not it's possible to do this without resorting to
>>> JavaScript. If it is, I would be overjoyed if anyone would point me in the
>>> right direction. If it isn't, I would appreciate help even more since I am
>>> not (yet) proficient in JavaScript.
>>>
>>>
>>> Many thanks in advance,
>>> Linus
>>>
>>
--
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/965838cb-cce7-4117-be47-c9830c7cb46e%40googlegroups.com.