[Newbie] Non-tag based collapsible table of contents

310 views
Skip to first unread message

Stu White

unread,
Jan 27, 2017, 2:04:46 AM1/27/17
to TiddlyWiki
Hello,

I've just started using Tiddlywiki after several years of vague dissatisfaction with Evernote and I'm really impressed with the tool and the things the community have done with it. It's wonderful.

One thing I'm struggling with slightly is setting up a nice collapsible contents page (or side bar, ideally) without using tags. The TableOfContents plugin is lovely and exactly the sort of widget I'd like, but it requires that I define a hierarchy of tags to set the structure. I'd rather that tags are non-hierarchical and more like a cross-cutting mix-in that I can apply to any tiddler, regardless of where it is in the contents.

For example, I'm looking to do something like:

- Language
  - Java
  - Scala
- Frameworks
  - Hibernate
  - Jersey
  - Akka 

But I'd like to be able to tag, say, Akka with a Scala tag and not have it appear under the Scala hierarchy in the table of contents. Ideally, I'd like the table of contents to be how I find things in a top-down navigation way, and the tags to be how I quickly find information regardless of where it is in the hierarchy based which categories it has been tagged with.

Thanks again for the awesome tool and awesome community. I wish I'd found this much earlier.

-- Stu

Jed Carty

unread,
Jan 27, 2017, 2:59:37 AM1/27/17
to TiddlyWiki
While it isn't exactly what you want, I made the GenTags plugin which lets you have multiple fields that act like tags. You would still need to use the tags field to make the table of contents but you could use another field for the other organisation.

I am very slowly working on a new widget that could replace the table of contents macros and it will hopefully allow you to use things like fields to set what the children of a node are, but it is going to be a while before that is ready.

PMario

unread,
Jan 27, 2017, 3:46:29 AM1/27/17
to TiddlyWiki
Hi Stu,

I did experiment with a TOC structure, that is based on a "parent" field. So instead of tags it uses the parent of a tiddler. Since tagging is deeply integrated, it has an easy workflow. My experiment needs manual field definition. No tag dropdowns and such...

I did stop the experiment, since I ran into some limitations and didn't really need  it :)

I could dig out the code, and see if I can fix and polish it a bit. ..... but no promises!

The TOC contains 6 different versions. I'll only create the "simple tree" and the "selective expandable"

I'll post it here.

have fun
mario

Jed Carty

unread,
Jan 27, 2017, 3:51:32 AM1/27/17
to TiddlyWiki
Mario,

I had forgotten about that. I think that from the last meet up we made a slightly more polished version of the tool using parent fields for the main twederation site before I started working on the new TOC widget for it. I will see if I have a usable version on any of the old sites.

PMario

unread,
Jan 27, 2017, 3:58:58 AM1/27/17
to TiddlyWiki
On Friday, January 27, 2017 at 9:51:32 AM UTC+1, Jed Carty wrote:
Mario,

I had forgotten about that. I think that from the last meet up we made a slightly more polished version of the tool using parent fields for the main twederation site before I started working on the new TOC widget for it. I will see if I have a usable version on any of the old sites.

I just had a look. ... My stuff still has some tagging involved, so may need more tweaking than I could remember :))

-m. 

PMario

unread,
Jan 27, 2017, 6:29:57 AM1/27/17
to TiddlyWiki
Hi Jed,


On Friday, January 27, 2017 at 9:51:32 AM UTC+1, Jed Carty wrote:
Mario,

I had forgotten about that. I think that from the last meet up we made a slightly more polished version of the tool using parent fields for the main twederation site before I started working on the new TOC widget for it. I will see if I have a usable version on any of the old sites.

I do have a proof of concept, using 5.1.14-prerelease code. How can we name it. toc-parent ?! is kind of weird.
May be: tocP and tocP-selective-expandable
what do you think?

-m

Tobias Beer

unread,
Jan 27, 2017, 7:29:42 AM1/27/17
to tiddl...@googlegroups.com
Hi Stu,

Assuming you define that list yourself as a basic list in wikitext, you can simply do something like:


All you'd need is some macro, perhaps called <<menu label="foo">> to render a collapsible element, e.g.

@@.nav
* <<menu "Level 1 A">>
** [[Item 1]]
** [[Item 2]]
* <<menu "Level 1 B">>
** [[Item 3]]
** <<menu "Level 2 A">>
*** [[Item 4]]
*** [[Item 5]]
@@

So, in Your case something like:

@@.nav
* <<menu "Language">>
** [[Java]]
** [[Scala]]
* <<menu "Frameworks">>
** [[Hibernate]]
** [[Jersey]]
** [[Akka]]
@@

Best wishes,

Tobias.

Stu White

unread,
Jan 30, 2017, 4:51:09 PM1/30/17
to TiddlyWiki
Hi, Tobias.

On Friday, 27 January 2017 12:29:42 UTC, Tobias Beer wrote:
Hi Stu,

Assuming you define that list yourself as a basic list in wikitext, you can simply do something like:


Yep, that sort of makes sense. I'm not sufficiently familiar with either CSS or Tiddlywiki macros but maybe I can have a play with that. I think I'll probably need to do some reading. 

Thanks,
Stu

Stu White

unread,
Jan 30, 2017, 4:52:22 PM1/30/17
to TiddlyWiki
Thanks, guys. That's really interesting -- if there's a prototype or anything I can look at to try to figure this stuff out then I'd really appreciate it.

Many thanks
Stu

PMario

unread,
Jan 30, 2017, 7:19:39 PM1/30/17
to TiddlyWiki
On Monday, January 30, 2017 at 10:52:22 PM UTC+1, Stu White wrote:
Thanks, guys. That's really interesting -- if there's a prototype or anything I can look at to try to figure this stuff out then I'd really appreciate it.

There will be something to test soon. ...

The first prototype worked, but was not very usable. With the initial workflow, there was way too much to type :) ... And since fields are hidden, it's extremely hard, to find the right tiddlers, to create the TOC structure. (at least for me :) .. So I needed to think about it. ...

I did create a new button, similar to "New Here" .. There is a "New Child Here", which automatically adds the parent field, to the new "child" tiddler. This button will be part of the tiddler toolbar after the plugin is installed.

There is a second button, which allows us to directly add new child tiddlers from within the TOC structure. So the whole mechanism should be usable, after I finished the refactoring and add the components to the "selective expandable - toc". Which is the biggest part, that's left :)

Yea, ... and there is no documentation yet :)

have fun!
mario


PMario

unread,
Feb 3, 2017, 10:56:36 AM2/3/17
to tiddl...@googlegroups.com
On Monday, January 30, 2017 at 10:52:22 PM UTC+1, Stu White wrote:
Thanks, guys. That's really interesting -- if there's a prototype or anything I can look at to try to figure this stuff out then I'd really appreciate it.

Hi Stu,

I did create a plugin at: https://wikilabs.github.io/editions/tocP/ .. proper INTRO thread will follow soon.

Important! -> Don't use your production TW for testing!

You can install the plugin by dragging the plugin link to your TW. The plugin contains a readme and a minimal UI to enable / disable the "New Child Here" buttons in the tree.

It contains the full functionality. So you have the same possibilities that come with the core toc macros.

tocP .. A simple tree
tocP-expandable .. A tree in which all the branches can be expanded and collapsed
tocP-selective-expandable .. A tree in which the non-empty branches can be expanded and collapsed

tocP-tabbed-internal-nav .. The target tiddler appears in the right-hand panel, replacing the tiddler that contained the link
tocP-tabbed-external-nav ..The target tiddler appears in the normal way (which depends on the user's configured storyview)


The tabbed versions don't have the "New Child" buttons

Feedback is very welcome.

have fun!
mario

---
edit: fix URL

Stu White

unread,
Feb 3, 2017, 11:32:59 AM2/3/17
to TiddlyWiki
Thank you so much -- that's awesome! I'm away this weekend but will download and have a play next week.

Thanks again for the help; the community here is first-class, and I'm very grateful.

Cheers,
Stu

PMario

unread,
Feb 6, 2017, 7:28:47 AM2/6/17
to tiddl...@googlegroups.com
On Friday, February 3, 2017 at 4:56:36 PM UTC+1, PMario wrote:
I did create a plugin at: https://wikilabs.github.io/tocP/ .. proper INTRO thread will follow soon.

changed the URL, to make it more consistent: https://wikilabs.github.io/editions/tocP/

-m

Mat

unread,
Feb 6, 2017, 2:20:22 PM2/6/17
to TiddlyWiki
On Friday, January 27, 2017 at 8:04:46 AM UTC+1, Stu White wrote:

Thanks again for the awesome tool and awesome community. I wish I'd found this much earlier.

Stu - welcome and, yeah TW is fantastic! Please be generous with your insight and spread the word!!! We need all the brains we can get ;-)

<:-)

Reply all
Reply to author
Forward
0 new messages