On Tuesday, January 28, 2020 at 9:44:22 PM UTC-8, Mohammad wrote: > > In any of toc macro is there any simple way to restrict the number of > levels? >
I've added a new optional "max" parameter to <<toc-tree>>, <<toc-all>> and <<toc-list>>. Thus: <<toc-all roottag 3>> will show a maximum of 3 levels. If you omit the "max" param, the full tree depth will be displayed as before. Note that if you also want to use the "exclude" param without a "max" value, you will need to use either named parameters <<toc-all here:roottag exclude:"ThisTag ThatTag">> or "" as a placeholder for the missing max param: <<toc-all roottag "" "ThisTag ThatTag">> Alternatively, you can use the <$macrocall> widget syntax, which always uses named parameters: <$macrocall $name="toc-all" here="roottag" exclude="ThisTag ThatTag" /> One minor tweak still to be done for <<toc-tree>>: when the 'max' level is reached, if more levels are present for that item it will still show an open/close arrow. Even so, toggling this arrow will NOT show any more levels. Give it a try and let me know how it goes... -e > > --Mohammad > > On Saturday, January 25, 2020 at 3:44:39 PM UTC+3:30, Eric Shulman wrote: >> >> On Saturday, January 25, 2020 at 3:26:21 AM UTC-8, Mohammad wrote: >>> >>> Recently Eric Shulman shared a very impressive tool which can be used >>> for authoring! >>> It can create an outliner, a feature (outlining) quite necessary in long >>> writings like novels, theses, project reports,... >>> It is a smart designed Table of Contents (TOC) generator. >>> >> and much more ... >>> >> >> In the "much more" category, see >> http://tiddlytools.com/InsideTW/#TiddlyTools%2FNavBar%2FBottom >> >> * <<toc-list>> (defined in TiddlyTools/TOC/Macros) is a VERY simple >> recursion, that returns the entire TOC contents as a simple list of tiddlers >> \define toc-list(here,exclude) >> <$list filter="""[title[$here$]tagging[]] $exclude$ -[[$here$]]"""> >> <$link/><br> >> <$macrocall $name="toc-list" here=<<currentTiddler>> exclude="""$exclude$ >> -[[$here$]]"""/> >> </$list> >> \end >> >> * TiddlyTools/NavBar/Bottom is a ViewTemplate addition that uses the >> <<toc-list>> output to present next/previous buttons to provide a >> "sequential reader" interface that lets you step through all the TOC items, >> one at a time. >> >> 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/f96df6eb-b401-4cbe-b18b-61543c09785a%40googlegroups.com.