Hello! I am new user of TiddlyWiki, I work on Windows, Google Chrome and have a problem when creating Table of Contents.
The following code works for me:
<<toc-selective-expandable ‘ML’ sort[created]>>
I obtain list of tiddlers tagged ML, which is sorted by creation date. Amazing!
But… 2 things:
I want to be able to customize this list e.g. ‘‘tiddlers with tag ML, but without tag Todo’’ etc. So filter notation would be awesome
I run into a problem when name of tag tiddler has apostrophe e.g. Cauchy’s Integral, then I am unable to create list of this tag using standard Table of Contents notation (hence again need of filter notation)
So what also works for me is that:
<<toc-selective-expandable [[ML]]>>
but I don’t seem to be able to do anything else to that. What code lines do not work for me:
<<toc-selective-expandable [tag[ML]]>>
<<toc-selective-expandable [[ML]sort[title]]>>
<<toc-selective-expandable [tag[ML]sort[title]]>>
<<toc-selective-expandable [tag[ML]!tag[Todo] >>
<<toc-selective-expandable [tag[ML]tag[Todo]>>
All of the above commands don’t produce a thing and I really wish they worked.
I would be really really thankful for help, because I love TiddlyWiki. And also I’m sorry if that’s stupid thing to ask or wrong place to post such quesion - I am absolute begginer. If that’s the case please tell me what should I do instead.
The $set widget gets the list of all tiddlers tagged with “Todo” and stores it in the “exclude” variable
<div class="tc-table-of-contents"> applies the TWCore pre-defined styles to suppress the “numbered bullet item” display
Using the $macrocall widget instead of the <<toc-selective-expandable ... >> macro syntax allows you to pass the value of the “exclude” variable as a parameter
To fix the second problem (where the root tag contains an apostrophe), enclose the root tag in double quotes:
<<toc-selective-expandable "Cauchy's Integral">>
The $macrocall syntax will also handle the second problem , since all the parameter values are already enclosed in double quotes.
So, it turns out this solution does NOT work for toc-tabbed-internal-nav and toc-tabbed-external-nav
Adding this point here (in addition to at talk.tiddlywiki.org) because this thread is newer, AND someone hitting their head against the wall wondering why it’s not working might feel a bit more sane if the issue is flagged.
The writeup for this issue includes some minor code changes to $:/core/macros/toc that will enable support for the use of the exclude parameter with toc-tabbed-internal-nav and toc-tabbed-external-nav.
Attached is a JSON file containing the modified $:/core/macros/toc, which I have tested on https://TiddlyWiki.com
As best I can tell, it fails when BOTH the tag and the exclude string have spaces.
This seems to be have been true (all along) for the toc-selective-expandable as well (which I never use, except now in testing).
Of course, I could make a workaround described earlier in this thread – setting a variable called excluded so that exclude=<<excluded>> could do the work in the toc macro.
But it seems the exclude parameter is of very limited use if it can’t be used on the fly (without framing a variable beforehand) for something as simple as excluding a tiddler that has spaces in the title, when the tag title also has spaces in it.
Before the TOC code change, the excluded variable contained a list of tiddlers titles that had already been “visited” and was applied internally using -[enlist<excluded>] to prevent infinite “loops” in the tree. In v5.3.0-prerelease, this variable can now also use filter syntax to generate a list of tiddler titles to be excluded (applied internally using -[subfilter<excluded>]). The TOC code changes also now permit this parameter to be passed in to toc-tabbed-external-nav. Since the value has always operated on a LIST, the correct usage to pass a specified title containing a space would be exclude="[[all Operator]]"
Note also that the tag parameter (used to specify the starting “root tag” for the tree) is NOT a list, and CAN contain spaces, since it is used internally via tag<__tag__>.
Many apologies for posting before trying more things!
(I had quickly tried some variant ways, but somehow tried all kinds of variants other than filter notation with quote-marks. I won’t bore you further with explaining why I got confused. Thanks for the prompt clarification!)