Extended TOC functionality

171 views
Skip to first unread message

Niels Bjerre

unread,
Sep 1, 2017, 10:30:56 AM9/1/17
to TiddlyWiki
TiddlyWiki has very nice tableOfContents functionality - eg macros: toc-selective-expandable and toc-tabbed-external-nav

The toc is based on tags.

I need a modified version of the toc functionality: 
  1.  Root nodes selected by a filter (not by 1 tag only)
  2.  Add a filter to child nodes in the TOC.
The macro (

$:/core/macros/toc) is a bit confusing (to me).


All hints or suggestions is welcomed!


Best wishes
Niels


PMario

unread,
Sep 1, 2017, 11:37:25 AM9/1/17
to TiddlyWiki
Hi Niels,

I did create Parent Based Toc macros - tocP - see: https://wikilabs.github.io/editions/tocP/ ... which should be ready to use, but doesn't exactly do what you describe.

-------------

The following stuff is EXPERIMENTAL but imo fits to your description! see attachment!
so
BACKUP! BACKUP! before you test it. ... It overwrites the core toc macros. So don't use in production atm.

important tiddlers:

 - aa and bb ... contain the "merge" field parameter
 - test-toc ... shows the full toc tree
 - test-toc-selective-expandable ... same as test-doc but expandable
 - text-???? ... just have a look ;)

Field description:

merge .. tiddler to be transcluded (have a look at aa and bb tiddlers, to see how to use it)
merge-mode ... block / inline (default)

Please test BUT DON'T US IN PRODUCTION TWs yet!
With the new merge-field you can create really crazy TOC combinations.

More info can be found in an other thread: https://groups.google.com/d/msg/tiddlywiki/eX3SYFlp_70/kpBEdAR1CQAJ

I haven't been happy with the outcome, that's why I didn't create a plugin from the experiment. ... But this may change.

Let me know, what you think? ... I may make a second plugin "tocM".

have fun!
mario

toc-merge-experiment-v0.0.2-all.json

Niels Bjerre

unread,
Sep 2, 2017, 11:20:02 AM9/2/17
to TiddlyWiki
Hi Mario

Thank You very much.

I believe that tocP can serve my purpose very well. 
If I get the time I will experiment with Your prototype of tocM and give feedback.

Thanks Again

Niels
Reply all
Reply to author
Forward
0 new messages