Discussion:
[tw5] toc-selective-expandable with more than one search criteria
(too old to reply)
'Martin Petersen' via TiddlyWiki
2018-12-04 16:38:39 UTC
Permalink
Good evening, I am just starting to explore this wonderful piece of
ingenuity so bear with me when I ask a silly question:

When I want to make a table of contents Tiddlly with the help of the
toc-selective-expandable command I can search for one tag but I fail to
combine two or more. Let’s say I have Tiddlys with the tag Company and some
of them have Text as another tag and some others have the tag Numbers (but
not the tag Text) and I would like to list only those Tiddlys with a
combination of the tags Company and Numbers (excluding those with the tag
Text). How do I do this and where is this documented?
Thanks for your help.
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
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/a901800f-1a6c-4f71-84bb-058d57581e84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Mark S.' via TiddlyWiki
2018-12-04 19:54:10 UTC
Permalink
Everybody loves the TOC macros ... and then immediately wants to change
them ! ;-)

Something like this comes up so often, there should probably be a comment
in the TOC documentation.

A partial solution is to use the "sort" parameter. You can make a sort
parameter perhaps like:

sort:"!tag[Text]"

The problem, if I recall correctly, is that the TOC macro will still create
branches, even if the branch has no "leaves". Still, it's a start.

Good luck!
-- Mark
Post by 'Martin Petersen' via TiddlyWiki
Good evening, I am just starting to explore this wonderful piece of
When I want to make a table of contents Tiddlly with the help of the
toc-selective-expandable command I can search for one tag but I fail to
combine two or more. Let’s say I have Tiddlys with the tag Company and some
of them have Text as another tag and some others have the tag Numbers (but
not the tag Text) and I would like to list only those Tiddlys with a
combination of the tags Company and Numbers (excluding those with the tag
Text). How do I do this and where is this documented?
Thanks for your help.
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
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/b29a9152-22bb-49be-9939-cfd9129d5da7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
TonyM
2018-12-04 23:54:32 UTC
Permalink
Martin,

On tiddlywiki.com for toc selective expandable we see

<div class="tc-table-of-contents">
<<toc-expandable "Contents">>
</div>

That is it calls the macro toc-expandable

In advanced search Shadows we find this is in
$:/core/macros/toc

Which on editing we see the definition

\define toc-expandable(tag,sort:"",itemClassFilter:" ",exclude,path)
<$vars tag="""$tag$""" sort="""$sort$""" itemClassFilter=
"""$itemClassFilter$""" excluded="""$exclude$ -[[$tag$]]""" path=
"""$path$/$tag$""">
<ol class="tc-toc toc-expandable">
<$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$]
-[[$tag$]] $exclude$""">
<$list filter="[all[current]toc-link[no]]" emptyMessage=<<toc-
expandable-empty-message>> >
<$macrocall $name="toc-unlinked-expandable-body" tag="""$tag$"""
sort="""$sort$""" itemClassFilter="""itemClassFilter""" exclude=<<excluded>>
path=<<path>> />
</$list>
</$list>
</ol>
</$vars>
\end

If you look in the define line you can see mention of parameter that appear
not fully documented. and exclude is simply added to the end of the filter.

Perhaps trying providing your own exclude parameter, perhaps even to
include something +[[tag]]

But I ask do you really want a TOC macro here, because the TOC requires
each tiddler be tagged with a tiddler higher up in the tree, and eventually
the root tiddler, is this still true when you try and exclude one of your
tags?

Regards
Tony
Post by 'Martin Petersen' via TiddlyWiki
Good evening, I am just starting to explore this wonderful piece of
When I want to make a table of contents Tiddlly with the help of the
toc-selective-expandable command I can search for one tag but I fail to
combine two or more. Let’s say I have Tiddlys with the tag Company and some
of them have Text as another tag and some others have the tag Numbers (but
not the tag Text) and I would like to list only those Tiddlys with a
combination of the tags Company and Numbers (excluding those with the tag
Text). How do I do this and where is this documented?
Thanks for your help.
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
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/19a55fda-d69d-4dc8-8ddf-37a5fcb773cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Martin Petersen' via TiddlyWiki
2018-12-05 13:00:04 UTC
Permalink
Tony and Mark, thanks so much for your replies. I think I will have to dive
deeper into tagging in TW as it seems to work not as I expected it to do.

Best regards

Martin
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
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/1697d09b-779b-46ac-8be2-3a5e8d039b86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
bimlas
2018-12-05 13:55:47 UTC
Permalink
Martin,

I do not quite understand what you want to achieve: filtering through
multiple tags is the point or the table of contents?

If this is the first option, maybe this plugin can help:
https://bimlas.gitlab.io/#Filter%20by%20multiple%20tags%20easily%3A%20FilteredTag%20example

I work on other solutions to make tags really useful, but all of them are
still in development. For example, type in the search box: "wiki #macro" -
it will list the related tags that you can apply for the search. Another
way to find tag on the Contents sidebar: Press >> next to the items to
"open" it (such as the table of contents), the related tags are listed on
the top of the sidebar - I would like to use the `kin` filter
(https://bimlas.gitlab.io/demo/tw5/kin-filter.html) on listing, so that
only those elements that are in the given context will appear.

Again I signal that *these are under development, do not use it in your own
wiki*.
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
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/f84cff47-547c-4c39-b83f-6d46cace5829%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
bimlas
2018-12-06 14:41:14 UTC
Permalink
I've accomplished the above-mentioned operation: You can try it out on the
https://bimlas.gitlab.io/demo/tw5/kin-filter-toc-demo.html page (scroll to
the "View of context - a more sophisticated toc macro powered by kin
filter" heading). Remember: still under development!
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
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/1ed7a6a2-7d65-4a1c-bba9-69640fe6c3fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...