Is it possible to make a Table of Contents that matches against two tags?

716 views
Skip to first unread message

Gregorio Luiz Gomez

unread,
Dec 6, 2014, 5:05:35 PM12/6/14
to tiddl...@googlegroups.com
Let's say I have the following structure of tiddlers, 3 projects that need a Research tiddler and a Resources tiddler:
  • Project A
    • Research
      • Subject A
    • Resources
      • Related Image A
  • Project B
    • Research
      • Subject B
    • Resources
      • Related Image A
  • Project C
    • Research
      • Subject C
    • Resources
      • Related Image A
On each Project tiddler I'd like to have a collapsable Table of Contents that lists any tiddler marked "Research" and "Project A". And another ToC that lists tiddlers marked "Resources" and  "Project A", is this possible?

At the moment what I've been doing is tagging tiddlers: "Project A Research", "Project B Research" to create the hierarchy I want, but it doesn't feel right... 
It feels like I'm creating more tags than I need to.. I'd much rather tag project specific tiddlers with "Project A", "Research" rather than "Project A Research". But I can't do that if I want pretty indented ToC's.

Can you guys point me towards what I'm missing to achieve the desired structure and navigation?


Thanks in advance for the help!

Greg.

Tobias Beer

unread,
Dec 6, 2014, 7:14:20 PM12/6/14
to tiddl...@googlegroups.com
Yes, a crosstable is indeed something very useful.
Something like x-tag in tbGTD for TWc...


(click x-tag in the toolbar on the desk)

I could trying to porting that uncommented short-handed piece of plugin-code to tw5,
with a more basic feature set.


Best wishes, Tobias.

Gregorio Luiz Gomez

unread,
Dec 6, 2014, 7:25:04 PM12/6/14
to tiddl...@googlegroups.com
Yes, a crosstable is indeed something very useful.
Something like x-tag in tbGTD for TWc...


(click x-tag in the toolbar on the desk)

I could trying to porting that uncommented short-handed piece of plugin-code to tw5,
with a more basic feature set.

Thanks for the reply Tobias. I've actually been looking at Taggly Tagging on your very own tiddlyspot. The behaviour I see here: http://taggly5.tiddlyspot.com/ is practically what I need.

Although I must say, so far I haven't been able to replicate the Taggly Tagging functionality found in that link or in this tiddler: http://tb5.tiddlyspot.com/#Developer

It's just blank, with or without passing a tag in the <<taggly>> macro.

Cheers,
Greg.

Tobias Beer

unread,
Dec 7, 2014, 3:35:49 AM12/7/14
to tiddl...@googlegroups.com
Hi Greg,
 
Thanks for the reply Tobias. I've actually been looking at Taggly Tagging on your very own tiddlyspot. The behaviour I see here: http://taggly5.tiddlyspot.com/ is practically what I need.

Yes, I have set up that spot to show the concept but haven't yet played around putting...


...and see if I can't even work with templates. Especially with list-search, it seems quite powerful to quickly find stuff and to also have it displayed neatly.

Will do and post back here.

Best wishes, Tobias.

Tobias Beer

unread,
Dec 7, 2014, 3:53:49 AM12/7/14
to tiddl...@googlegroups.com
I think you can actually achieve what you want by combining these two...
      • or actually using a toc for having it expandable / collapsible
        • simple instructions
        • with the idea of always showing the toc below each tiddler with the current tiddler being the ToC tiddler
    I'll see if I can create an example.

    Best wishes, Tobias.

    Tobias Beer

    unread,
    Dec 7, 2014, 3:56:20 AM12/7/14
    to tiddl...@googlegroups.com
    Hi Greg,
     
    Although I must say, so far I haven't been able to replicate the Taggly Tagging functionality found in that link or in this tiddler: http://tb5.tiddlyspot.com/#Developer

    Yes, I need to update the instructions on that to be clear. If you want to use that state setting and have it searchable, you also need to install list-search or you won't see a thing.

    Best wishes, Tobias.

    Tobias Beer

    unread,
    Dec 7, 2014, 5:10:00 AM12/7/14
    to tiddl...@googlegroups.com
     Hi Greg,
     
    Although I must say, so far I haven't been able to replicate the Taggly Tagging functionality found in that link or in this tiddler: http://tb5.tiddlyspot.com/#Developer

    One more thing, I had to roll back on list-search as it was actually not working ...meaningfully.

    If the filter term was not found at a parent, then the parent including its subtree was hidden, even if there were matching children. Obviously that does indeed require a plugin rather than a "simple" macro, as there is no way to do it with css, i.e. "show parent if any children have a class callec match", otherwise hide.

    Best wishes, Tobias.

    Gregorio Luiz Gomez

    unread,
    Dec 7, 2014, 7:54:01 AM12/7/14
    to tiddl...@googlegroups.com
    One more thing, I had to roll back on list-search as it was actually not working ...meaningfully.

    Does that mean you have Tiddly under source control? How useful is it, being it's all one file?

    Also, I feel by the very nature of the TW architecture this isn't possible, but just to confirm, there's no way maintain some kind of link with plugins and their source? Does updating plugins literally mean keeping an eye on the devs communication channels and dragging over an updated file to my personal TiddlyWiki? There is no repo or submodule functionality to pull in upstream changes for plugins, right?


    Yes, I need to update the instructions on that to be clear. If you want to use that state setting and have it searchable, you also need to install list-search or you won't see a thing.

    Ah, now it's coming together! I've achieved part of what by hacking at your hard work :)
    <<list-search
    "[tag[ProjectA]tag[Research]]"
    "search"
    "$:/temp/ProjectAResearch"
    "$:/template/tagList">>

    in my "$:/template/tagList" I modified your "$:/template/tagged-timeline" to just display title and tags:
    <div class="tagList-item">
    <dt>
    <$link to={{!!title}}><$view field="title"/></$link>
    </dt>
    <dd class="tagList-tags">
    <$list filter="[all[current]tags[]sort[title]]-[
    <remove>]" template="$:/core/ui/TagTemplate"/>
    </dd>
    </div>

    It's a shame that the ToC macro doesn't accept two tags like list-search does. Then I think I would have self-managing hierarchy I desire! :)

    Thanks for the help and all the hard work Tobias, I see you everywhere I look for TW documentation. haha

    Cheers,
    Greg.

    Tobias Beer

    unread,
    Dec 7, 2014, 3:59:04 PM12/7/14
    to tiddl...@googlegroups.com
    Hi Greg,
     
    Does that mean you have Tiddly under source control? How useful is it, being it's all one file?

    Nope, not yet. I simply reversed the functionality on tb5. The one file thing is what I have used so far, except for binaries which I prefer to keep outside unless we're talking really small images for ui components.
     
    I feel by the very nature of the TW architecture this isn't possible, but just to confirm, there's no way maintain some kind of link with plugins and their source?

    It is possible insofar as you can use node and github repositories to cook your desired TiddlyWiki's. You can have one built command that lets you build a server-tw which syncs back individual tiddlers to your node store and you can have another build command that builds that singlefile-selv-contained wiki that stores itself in its entirety. Two different approaches that you can sure combine, so long as you manage to keep track.

    I have not even started versioning my little "snippets" yet... which will change with GitHub.
     
    Does updating plugins literally mean keeping an eye on the devs communication channels and dragging over an updated file to my personal TiddlyWiki

    Right now, yes, unless...
    1. your plugin author has a stable code-repo
    2. you're merging his changes into your local copy and
    3. build your TiddlyWiki(s) based on those updated plugins
    Not sure if I'd recommend that because you do want to keep an eye on changes and have a way to verify one-by-one if there are things that break.

    At some point, there will surely be some sync adapter that allows you to check your plugin source for updates.

    Plugins are really just "Tiddler-Bundles", so they can be anything from code to content... the task is really not "keeping plugins up to date" but rather to keep any "remote bundles" up to date.

    There is no repo or submodule functionality to pull in upstream changes for plugins, right?

    Not until those repos actually exist, which is true for those plugins that you find in the core repo. So far, I have yet to set mine up for others to pull from and include. Not sure, if automation actually scares me or not, because the degree at which "tested code" is going to be expected will surely be much higher than it traditionally was in this community.

    Ah, now it's coming together! I've achieved part of what by hacking at your hard work :)
     
    <<list-search
    "[tag[ProjectA]tag[Research]]"
    "search"
    "$:/temp/ProjectAResearch"
    "$:/template/tagList">>

    Again, right now, you can either use list-search or taggly, not both, I'm afraid... since you won't see any matching children for your filter string when using both in combination.
     
    in my "$:/template/tagList" I modified your "$:/template/tagged-timeline" to just display title and tags:
     
    <div class="tagList-item">
    <dt>
    <$link to={{!!title}}><$view field="title"/></$link>
    </dt>
    <dd class="tagList-tags">
    <$list filter="[all[current]tags[]sort[title]]-[
    <remove>]" template="$:/core/ui/TagTemplate"/>
    </dd>
    </div>

    It's a shame that the ToC macro doesn't accept two tags like list-search does. Then I think I would have self-managing hierarchy I desire! :)

    Not sure what you mean, list-search doesn't really accept "two tags". What it does is allow you to define any arbitrary filter which, in addition can be filtered via some search mode defined by you. With any list widget implementation you are free to define any template you want, with or without tags, etc...

    Thanks for the help and all the hard work Tobias, I see you everywhere I look for TW documentation. haha

    Call it a passion project. ^^

    Best wishes, Tobias.

    Jeremy Ruston

    unread,
    Dec 7, 2014, 4:12:44 PM12/7/14
    to TiddlyWiki
    Hi Gregorio

    Does that mean you have Tiddly under source control? How useful is it, being it's all one file?

    Also, I feel by the very nature of the TW architecture this isn't possible, but just to confirm, there's no way maintain some kind of link with plugins and their source? Does updating plugins literally mean keeping an eye on the devs communication channels and dragging over an updated file to my personal TiddlyWiki? There is no repo or submodule functionality to pull in upstream changes for plugins, right?

    The upgrade wizard at http://tiddlywiki.com/upgrade.html automatically upgrades all of the plugins in the TiddlyWiki library (that is, the official plugins available on tiddlywiki.com). Rather than connecting to GitHub to get them, the plugins are actually embedded in the upgrade.html.
     
    It's a shame that the ToC macro doesn't accept two tags like list-search does. Then I think I would have self-managing hierarchy I desire! :)

    Actually, the core toc macro can be mildly abused so that it can accept multiple tags at the top level.

    The critical line in the toc macro that uses the tag parameter is:

    <$list filter="""[tag[$tag$]!has[draft.of]$sort$]""">

    So, you can actually pass multiple tags like this:

    <<toc "onetag]tag[anothertag">>

    Best wishes

    Jeremy.
     

    Thanks for the help and all the hard work Tobias, I see you everywhere I look for TW documentation. haha

    Cheers,
    Greg.

    --
    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 tiddl...@googlegroups.com.
    Visit this group at http://groups.google.com/group/tiddlywiki.
    For more options, visit https://groups.google.com/d/optout.



    --
    Jeremy Ruston
    mailto:jeremy...@gmail.com
    Reply all
    Reply to author
    Forward
    0 new messages