INTRO: tocP - Parent field based Table Of Content

563 views
Skip to first unread message

PMario

unread,
Feb 6, 2017, 7:58:36 AM2/6/17
to tiddl...@googlegroups.com
Hi folks,

I did create an alternative version to create a TOC.
A plugin at: https://wikilabs.github.io/editions/tocP/ ... it's beta atm!

Triggerd by the Non-tag based collapsible table of contents thread and based on an old experiment.

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

Pit.W.

unread,
Apr 19, 2017, 2:23:52 PM4/19/17
to tiddl...@googlegroups.com

Hello PMario,

great plugin. This opens the possibility of a 2-dimensional knowledge management, tags vs. fields.

I am now fiddling with connecting it to TiddlyMap, tidgraph and timeline ... no idea how that will work out, but I will see... Maybe planning vs. actual in a project management environment? Or a connction to tocP, creating a 3D-matrix ? Just thinking...

What I have already found out:

If the tocP is integrated into a conditional template (like a footer) it works with an adaption like so:

<<tocP-selective-expandable '$(currentTiddler)$'>>

where '$(currentTiddler)$' is a variable replacing the title of the tiddler which calls the conditional template. Same as in the standard ToC

At the moment I am still struggling to understand the difference between the two "NewHere"buttons, they seem to be identical except for the icon - or maybe am just not seeing the point... But then, you made it absolutely clear that this is a beta version.

I like the new-button in the tree - great. It encourages brainstorming.  That would be great in the standard-ToC as well. Or even: both side by side for 2-dimensional brainstorming ...  okokok, I got a little finger and now I am grabbing for the whole hand ... shame on me.


Thank you for the plugin.

Kind regards,

Pit.W

Am 2017-02-06 um 13:58 schrieb PMario:
Hi folks,

I did create an alternative version to create a TOC.
A plugin at: https://wikilabs.github.io/editions/tocP/ ... it's beta atm!

Triggerd by the Non-tag based collapsible table of contents thread and based on a

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
--
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/49467b45-e1fa-4869-b9e6-e738fb915e71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




PMario

unread,
Apr 19, 2017, 7:23:36 PM4/19/17
to TiddlyWiki, Pi...@eclipso.ch
On Wednesday, April 19, 2017 at 8:23:52 PM UTC+2, Pit.W. wrote:

Hello PMario,

great plugin. This opens the possibility of a 2-dimensional knowledge management, tags vs. fields.


glad that you like it.
 

I am now fiddling with connecting it to TiddlyMap, tidgraph and timeline ... no idea how that will work out, but I will see... Maybe planning vs. actual in a project management environment? Or a connction to tocP, creating a 3D-matrix ? Just thinking...


I'm interested if it works out. ... imo Tiddlymap uses a different mechanism to describe connections (edges) but the idea is interesting.
 
At the moment I am still struggling to understand the difference between the two "NewHere"buttons, they seem to be identical except for the icon - or maybe am just not seeing the point...

You are right. They do th same thing. I used different icons since they don't look right. The tiddler toolbar icon doesn't look good in the tree an vice versa. So may be a new icon, which looks good with both sizes may be better. We'll see. 
 

I like the new-button in the tree - great. It encourages brainstorming.  That would be great in the standard-ToC as well. Or even: both side by side for 2-dimensional brainstorming ... 


We could try to create a PR with NewHere buttons in the TOC macro. Should be relatively straight forward.
Drag and Drop was requested too already in a different thread. ...

So no promises! But it would be interesting, if more users want those features...
 

okokok, I got a little finger and now I am grabbing for the whole hand ... shame on me.


:)


Thank you for the plugin.

Kind regards,

Pit.W


you are welcome!

-mario
Message has been deleted

PMario

unread,
Apr 23, 2017, 5:20:21 AM4/23/17
to TiddlyWiki, Pi...@eclipso.ch

Hi folks,


Pit.W requested to make the field name configurable. ... Which points out, that I need to improve the docs, since it actually is configurable already :)


Have a look at: https://wikilabs.github.io/editions/tocP/#test-tocP-asdf

The tiddler contains a warning, which I will change to "Important", so it should be less frightening. ... The filed name can be specified like so:


<div class="tc-table-of-contents">
<<tocP root field:"asdf">>
</div>

I still use root as the entry point, but this can be changed too.

Hope that helps.

have fun!
mario

Pit.W.

unread,
Apr 23, 2017, 9:01:32 AM4/23/17
to tiddl...@googlegroups.com

Hi Mario,


thanks again, for the plugin, your quick answer, your advice, and your patience.

The field-configuration just solved a problem I had since a looooong time.

Also, the macro now opens a smooth possibility to have in TW a datamodel similar to a relational 1:n database, with the button in the tree being the complete GUI.


Thanks again!


Pit.

--
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 https://groups.google.com/group/tiddlywiki.

@TiddlyTweeter

unread,
Apr 23, 2017, 12:40:23 PM4/23/17
to TiddlyWiki
Ciao Mario

I did create an alternative version to create a TOC.
A plugin at: https://wikilabs.github.io/editions/tocP/ ... it's beta atm!

Triggerd by the Non-tag based collapsible table of contents thread and based on an old experiment.

Great stuff. Tx.

I did a test with it and see it could be very useful when you need, for instance, to create a contents navigator for e-pubs with deep, complex, logical structures.

Some cases, like many novels, for instance, tagging is not relevant and actually confuses the issue. Their strict ordering is needed but not categorization. So I like this both for its utility and its logical clarity.

Best wishes
Josiah

PMario

unread,
Apr 24, 2017, 4:56:20 AM4/24/17
to TiddlyWiki, Pi...@eclipso.ch
On Sunday, April 23, 2017 at 3:01:32 PM UTC+2, Pit.W. wrote:

thanks again, for the plugin, your quick answer, your advice, and your patience.


:)
 

The field-configuration just solved a problem I had since a looooong time.


That's cool.
 

Also, the macro now opens a smooth possibility to have in TW a datamodel similar to a relational 1:n database, with the button in the tree being the complete GUI.


I'd like some feedback here, which additional info should be shown, to give a visual indication about the "parent" field used. ... As a first step I was thinking about a tooltip, that contains the name of the parent field.

At the moment, the author has to make it clear with some additional text for the users.

-m


PMario

unread,
Apr 24, 2017, 5:11:17 AM4/24/17
to tiddl...@googlegroups.com
On Sunday, April 23, 2017 at 6:40:23 PM UTC+2, @TiddlyTweeter wrote:
I did a test with it and see it could be very useful when you need, for instance, to create a contents navigator for e-pubs with deep, complex, logical structures.

Yea, that was the intention. ... I still think the existing "tag" mechanism should be the preferred way to create TOCs for new users, because it automagically creates "meta-data" that is useful (for future use), without the user even being aware...

Using fields adds complexity and adds to the learning curve. eg: new UI was needed to make the workflow easier. ... So I'd recommend it, for more experienced users.

I'm also a big fan of "visual" information. eg: tags :). So I try to avoid "hidden" information, and even be "vocal" against it. ... But IMO tocP enables a new TOC categorys. ... Just the "visual" output of the macros has potential, to be improved ;)
 
Some cases, like many novels, for instance, tagging is not relevant and actually confuses the issue.
 
Their strict ordering is needed but not categorization.
 
So I like this both for its utility and its logical clarity.

Good summary!

-m

PMario

unread,
May 5, 2017, 11:14:05 AM5/5/17
to TiddlyWiki
Hi folks,

I did create an update: https://wikilabs.github.io/editions/tocP/

----
new in 0.1.0
  • improved / fixed tool button tooltips
  • fixed plugin license typo
  • new StyleSheet setting for .tocp class. It sets the default link color to green, which should set it apart from the standard toc.
    • This is probably a temporary solution, because it doesn't work for tabbed tocPs.
  • The "New Child" buttons now show a more detailed tooltip.
    • The actual "field-name: value" pair which will be used to create the new child.
  • tocP now shows the tooltip field, if available in tiddlers. see examples or open level-1 in edit mode.

have fun!
Mario

@TiddlyTweeter

unread,
May 5, 2017, 8:24:31 PM5/5/17
to TiddlyWiki
A brilliant plugin IMO.

Its really useful a lot of the time in creating structure where the use of tags is not right. I never liked tags for structuring. This lets me keep a clear separation between tags and structure.

Josiah

Birthe C

unread,
May 5, 2017, 8:39:20 PM5/5/17
to TiddlyWiki
Hi Mario,

This is a lovely plugin. On your demo site I do see the green link colour, but not in my own TW. I tried to edit the stylesheet tiddler, but the colour does not change.

Birthe

PMario

unread,
May 6, 2017, 2:00:02 PM5/6/17
to tiddl...@googlegroups.com
Hi,

Did you add the new class name as shown below?

<div class="tocp <-----  tc-table-of-contents">
<<tocP root>>
</div>

It can be any name you want. ... You just need to set up some style sheet settings with your own name.
This makes it possible, to use different colors for different field names and have a much better visual differentiation.

-m

Birthe C

unread,
May 6, 2017, 2:10:47 PM5/6/17
to TiddlyWiki
Sorry and thank you, Mario! I am an idiot. I did not add the class and on top of that I also misspelled the name of my preferred colour.

Birthe



Den lørdag den 6. maj 2017 kl. 20.00.02 UTC+2 skrev PMario:
Hi,

Did you add the new class name as shown below?

<div class="tocp <-----  tc-table-of-contents">
<<tocP root>>
</div>

-m

Damon Pritchett

unread,
Jul 21, 2019, 5:08:50 PM7/21/19
to TiddlyWiki
Hello,

I'm trying out your tocP plugin and I like it a lot. The only trouble I'm having is in adding a sort option. I have a field entitled content-index which contains a numeric value indicating the order I would like things to appear. I tried adding sort[content-index] to the macro call, but it has no effect. It always sorts on the title (or caption if there is one). I'm using a custom field in for the TOC generation so am wondering if this is where the problem might lie. I haven't tried the default parent field yet, but that's next.

Thanks,

Damon

Aidan Grey

unread,
Jul 21, 2019, 6:32:01 PM7/21/19
to tiddl...@googlegroups.com
Use nsort (content-index)

Nsort = numeric sort

Theres also sortcs (case sensitive), and a few others.

--
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.

Damon Pritchett

unread,
Jul 21, 2019, 6:41:15 PM7/21/19
to TiddlyWiki
Nope. Same thing. I even tried using the default parent field as the main parameter. It always sorts on the title or caption if present not my custom field no matter which sort operator I use.

Damon

On Sunday, July 21, 2019 at 3:32:01 PM UTC-7, Aidan Grey wrote:
Use nsort (content-index)

Nsort = numeric sort

Theres also sortcs (case sensitive), and a few others.

On Sun, Jul 21, 2019, 3:08 PM Damon Pritchett, <damon.p...@gmail.com> wrote:
Hello,

I'm trying out your tocP plugin and I like it a lot. The only trouble I'm having is in adding a sort option. I have a field entitled content-index which contains a numeric value indicating the order I would like things to appear. I tried adding sort[content-index] to the macro call, but it has no effect. It always sorts on the title (or caption if there is one). I'm using a custom field in for the TOC generation so am wondering if this is where the problem might lie. I haven't tried the default parent field yet, but that's next.

Thanks,

Damon


On Saturday, May 6, 2017 at 11:00:02 AM UTC-7, PMario wrote:
Hi,

Did you add the new class name as shown below?

<div class="tocp <-----  tc-table-of-contents">
<<tocP root>>
</div>

It can be any name you want. ... You just need to set up some style sheet settings with your own name.
This makes it possible, to use different colors for different field names and have a much better visual differentiation.

-m

--
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 tiddl...@googlegroups.com.

Aidan Grey

unread,
Jul 21, 2019, 7:02:35 PM7/21/19
to tiddl...@googlegroups.com
Hmm.... What's the exact text of the call? I use tocp sorting on a custom field in every one of my TWs with no problems....

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/4d5f7d0e-6c71-4856-9586-da12b02b2fc5%40googlegroups.com.

Damon Pritchett

unread,
Jul 21, 2019, 7:04:52 PM7/21/19
to TiddlyWiki
Nothing special:

<div class="tocP tc-table-of-contents">
<
<tocP-selective-expandable histories sortan[content-index]>>
</div>

I use the sortan[content-index] just fine in the normal TOC.

Aidan Grey

unread,
Jul 21, 2019, 7:09:39 PM7/21/19
to tiddl...@googlegroups.com
Ah, there it is.  Mine: 

<div class="tocp tc-table-of-contents">
<<tocP-selective-expandable root "nsort[ord]">>
</div>

you need <<tocP-selective-expandable histories "sortan[content-index]">>

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/4951cab2-e6de-4182-9506-63d97723281f%40googlegroups.com.

Damon Pritchett

unread,
Jul 21, 2019, 7:15:38 PM7/21/19
to TiddlyWiki
So I tried that to no avail. However, when that happened, I looked back at my field name and noticed that it was contents-index, not content-index. That fixed the problem and worked with and without the quotes. Thanks for prodding me in the right direction. Silly me.

Damon

Aidan Grey

unread,
Jul 21, 2019, 8:20:10 PM7/21/19
to tiddl...@googlegroups.com
Can't tell you how many times I've done that. :)

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f7e910b3-3228-427d-900b-a0935c118823%40googlegroups.com.

PMario

unread,
Jul 22, 2019, 2:00:30 AM7/22/19
to TiddlyWiki
Hi Damon,

This works for me. See the double-quotes.

<div class="tocp tc-table-of-contents">
<<tocP root "sortan[content-index]">>
</div>

-m

damscal

unread,
May 17, 2021, 6:15:07 AM5/17/21
to TiddlyWiki
Thank you Mario for this useful plugin

As far as I'm understanding, the parent field only accepts a single tiddler, not a list, and the toc is forced to be strictly hierarchical (there can only be a single path to each listed tiddler). Am I right?

PMario

unread,
May 17, 2021, 6:34:10 AM5/17/21
to TiddlyWiki
On Monday, May 17, 2021 at 12:15:07 PM UTC+2 damscal wrote:
Thank you Mario for this useful plugin

You are welcome!
 
As far as I'm understanding, the parent field only accepts a single tiddler, not a list, and the toc is forced to be strictly hierarchical (there can only be a single path to each listed tiddler). Am I right?

Everything right! ... There are some issues at github: https://github.com/wikilabs/plugins/issues?q=is%3Aissue+is%3Aopen+label%3Atocp that talk about a possibility to add more than 1 parent. ...

I was thinking about it, but I didn't find a good way to "show" the result in a "clean" way.

Can you specify your usecase, that would need 2 or more parents? ...

AND can you describe, how the result should look like?

-mario

damscal

unread,
May 17, 2021, 7:27:30 AM5/17/21
to TiddlyWiki
Thank you for the quick reply. I'd say there would be several usecases, I can think of the following examples:
  • user wants to organize his music by genre, but music pieces often are a mix of several genres, and creating hundreds of sub-genres wouldn't be very practical
  • tiddlers have long paths in the toc hierarchy and user would like to create some shortcuts in the toc
  • user has poor memory and relies on browsing rather than searching. Having a tiddler show in multiple paths increases the likeability that the user can find it
How the result should look like:
Multiple parents work well in the standard tag-based toc macros, perhaps the same result would be alright.

What obstacles did you find more specifically? If you feel like to get back working up this plugin, I can be available to provide user feedbacks and design suggestion, here or on github, whichever is more appropriate. Unfortunately I know little of TW's APIs myself.
Reply all
Reply to author
Forward
0 new messages