Have a look in TW-Script! A solution by Eric Shulman shows how to exclude a tag and how simply prevent a recursion loop! much simpler than the official toc macro!
https://kookma.github.io/TW-Scripts/#A%20Simple%20Recursive%20TOC%20Macro Best wishes Mohammad On Mon, Apr 19, 2021 at 10:11 PM Jean-Pierre Rivière < [email protected]> wrote: > About recursive macro, they may be possible, but the problem is how to > stop the recursion. Your example works if there is no loop created by > tagging. > > The problem is we don't have a proper <<if>> macro to decide what to do > (control recursion call in that case). Or how do you do that? > > Le dimanche 18 avril 2021 à 21:36:33 UTC+2, Soren Bjornstad a écrit : > >> I've never tried to do a recursive* filter*, so I don't know what's >> technically possible (though I've never seen someone try to use multiple >> filter runs in *subfilter* and am a bit suspicious that the second run >> is doing a tagging[] on everything in your wiki). But recursive macros are >> easy and functional, and I suspect they'll work for your use case. Here's >> one version that does an outline of the TOC on tiddlywiki.com, using the >> current tiddler to easily pass the state through to the next level: >> >> \define recurse() >> <$list filter="[all[current]tagging[]]"> >> <li><<currentTiddler>><ul> >> <<recurse>></ul></li> >> </$list> >> \end >> >> <$tiddler tiddler="TableOfContents"> >> <ul> >> <<recurse>> >> </ul> >> </$tiddler> >> >> On Sunday, April 18, 2021 at 2:01:51 PM UTC-5 Yaisog Bonegnasher wrote: >> >>> Hi, >>> I recently tried to create a recursive subfilter to find all tiddlers >>> below a certain tag, no matter how many levels deep (similar to the >>> *kin* filter, which is too slow for my large wiki). Unfortunately, I >>> was greeted with a red-message-box-of-death informing me of too much >>> recursion. However, there should only be a couple of levels. >>> Are recursive filters at all possible or am I doing something wrong? >>> For a quick example, try this in a new tiddler on tiddlywiki.com: >>> \define subfilter-test() [tagging[]] [tagging[]subfilter<subfilter-test>] >>> >>> <$set name="test" filter="[[TableOfContents]subfilter<subfilter-test>]"> >>> <$list filter="=[enlist<test>]" template="$:/core/ui/ListItemTemplate" >>> /> >>> </$set> >>> Any enlightment is greatly appreciated. >>> Best regards >>> Yaisog >>> >> -- > 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/8c52e9b8-e9a4-4682-9152-8ce19b5335aan%40googlegroups.com > <https://groups.google.com/d/msgid/tiddlywiki/8c52e9b8-e9a4-4682-9152-8ce19b5335aan%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAAV1gMAFOhabQLqGhPLCszwbxTDoe64OsD7g46RUVsQ7tkiWfg%40mail.gmail.com.

