excellent!

seriously the doc is confusing. there is a difference b/w intersection in 
the mathematical sense and the way things are described in the docs.


On Friday, June 26, 2015 at 11:05:04 AM UTC-4, c pa wrote:
>
> For simple lists that works. I needed a more robust solution and solved 
> the problem with the following code: -simplified
>
> \define displayAuthor(tiddlerName)
>     <!-- This macro (for demo purposes) displays the author's name in a 
> list. You can use the variable tiddlerName for any purpose -->
>     <li>$tiddlerName$</li>
> \end
> \define runMacroOnFilterIntersection(filter1, filter2, macroName)
>     <!-- This macro runs a passed macro once per value that exists in both 
> filter1 and filter2 -->
>     <$list filter="$filter1$" variable="filter1">
>         <!-- Now that we have one item from filter1 (in the variable 
> filter1), lets compare it to filter2 -->
>         <$list filter="$filter2$" variable="filter2">
>             <!-- We now have the first item in filter2 (In the variable 
> filter2) run the macro only if the two values filter1 == filter2 -->
>             <$reveal default=<<filter1>> type="match" text=<<filter2>> >
>                 $macroName$
>             </$reveal>
>         </$list>
>     </$list>
> \end
>
> <!-- Example of a set of complex filter calls. In the filter you must use 
> [field:title[ because a passed [[ gets parsed -->
> <$macrocall $name="runMacroOnFilterIntersection"
>             filter2="[list[!!authors]]" 
>             
> filter1="[field:title[$:/data/authors]indexes[]removeprefix[alt:]]"
>             macroName="<$macrocall $name='displayAuthor' 
> tiddlerName=<<filter2>> />"
> />
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a612e70e-1254-4bf3-a297-6b9ac2077801%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to