Thanks Eric! This also works. I'm impressed that you remember what you did and retrieve data from the large set of macros/functions you've written. I'm guessing you've got to hand some form of searchable database that allows the retrieval of bite-sized data chunks :)
Regards, Bob On Sunday, 9 August 2020 16:00:49 UTC+1, Eric Shulman wrote: > > On Sunday, August 9, 2020 at 5:04:13 AM UTC-7, Bob Flandard wrote: >> >> I'm trying and failing to write a filter expression that lists all >> tiddlers that are tagged "some name" (call this list of tiddlers resultA) >> and then extend that list to include all tiddlers that are tagged with the >> names in resultA. For the general case this would continue recursively >> until no new tiddlers were added to the list. >> > > I did exactly this function as part of the InsideTW "page navigation" > interface. > > It does a recursive "walk" of a "tag tree", and generates a flat list of > tiddler titles: > > \define toc-list(here,max,exclude,level:"1") > <$list filter="""[tag[$here$]] $exclude$ -[[$here$]]"""> > <$link /><br> > <$reveal default="$level$" type="nomatch" text="$max$"> > <$macrocall $name="toc-list" here=<<currentTiddler>> max="$max$" > exclude="""$exclude$ -[[$here$]]""" level={{{ [[$level$]add[1]] }}}/> > </$reveal> > </$list> > \end > > Invoke it like this: > <<toc-list "some name">> > where "some name" is the top-level tag for your tree. > > Notes: > 1) There is also an optional "max" parameter to limit the depth of > traversal > 2) The "exclude" and "level" parameters are only for internal use by the > macro itself > 3) The default output just lists each title, one per line. If you want a > bullet list, you could change this line: > <$link /><br> > to this: > <li><$link /></li> > and if you want a numbered list, also wrap the macro invocation within > <ol>...</ol>, like this: > <ol><<toc-list "some name">></ol> > > enjoy, > -e > -- 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a5e0bf81-c83c-40e8-84a8-7e3b25a42db6o%40googlegroups.com.