[TW5] [Feature request] Intra tiddler Table of contents

125 weergaven
Naar het eerste ongelezen bericht

André Carvalho

ongelezen,
11 apr 2019, 11:44:3511-04-2019
aan TiddlyWiki
Hi all

I used a TiddlerToCPlugin in Classic TiddlyWiki that was perfect ( See example at http://acarvalho.tiddlyspot.com/#%5B%5BWriting%20Good%20Requirements%5D%5D ). And can not find anything similar for 5.

I'm not a Javascript programmer but I do not see any architectural obstacle to do an intra-tiddler TOC and it is a feature that is essential for my way of using TiddlyWiki so I would be thankful to anyone that point me to some sort of solution.

Please keep the "tiddler philosophy" off the discussion, TiddlyWiki is a tool, an amazing one, and I'll use it as I can and want.
I think that we lost a lot (and gained another lot) on the breaking upgrade from Classic and I do not see TW 5 plugins gaining momentum to get even close to what we had in Classic. That's unfortunate because TiddlyWiki is such an amazing tool that can be used in so much different ways. In my humble view part of the problem may be the excessive use of the "tiddler philosophy" answer... if it is architecturally possible, please, just consider it (or ignore it if you want) and let each user decide how they want to use our beloved TiddlyWiki.

Best regards
André


Mark S.

ongelezen,
11 apr 2019, 13:30:3511-04-2019
aan TiddlyWiki
Probably the official way you'd do this is to have a tiddler that lists your tiddlers. That becomes your TOC. Have a button that opens all the tiddlers in your story. Use a templates and styles to hide the divisions between tiddlers. Now it will look like a single page with a TOC, and you can navigate to "sections",  but behind the scenes it's using tiddlers. I'm sure this has been done somewhere already.

You could also look at this post https://groups.google.com/forum/#!msg/tiddlywiki/ikjxwjllFtE/CYlY6UwrAQAJ that shows a method to allow you to have anchors in tiddlers again. But I think you would have to hand-make the TOC.

Good luck!

David Gifford

ongelezen,
11 apr 2019, 13:48:0111-04-2019
aan TiddlyWiki
From the example André gave I think he is saying he would like a plugin that grabs the headers (!) (!!) etc, in a tiddler and creates a toc from them.

With the recent workaround for section ID's (https://groups.google.com/forum/#!searchin/tiddlywiki/anchor%7Csort:date/tiddlywiki/ikjxwjllFtE/wIfyXCCsCQAJ), would this now be possible to create?

Dave

Mark S.

ongelezen,
11 apr 2019, 17:12:2211-04-2019
aan TiddlyWiki
With a regular expression extractor (PR #2963) I can imagine a TOC being generated (though the order would probably have to be set by the id #s).

-- Mark

TonyM

ongelezen,
11 apr 2019, 18:04:1011-04-2019
aan TiddlyWiki
Andre

As dave and mark have said I am confident a toc to anchors can be done since the workaround became available and people have seperatly generated lists from content.

A posible approach is to create a macro you pass a filter to that lists a set of tiddlers inside another tiddler generating both the toc and the anchors to each heading. This could be extended to have additional features.

Until 5.1.20 you could count the number of tiddlers you need headings for, then provide this as the top number in the range operator, to increment the id you generate on the fly. Use qualify to make your anchor ids unique to this listing.

List this range once to create the links or toc and a second time to generate tge anchors and tranclude the tiddler content.

I would build this but Im on the road for a few days (to Hill End NSW)

regards
tony

Regards

S. S.

ongelezen,
12 apr 2019, 03:36:3212-04-2019
aan TiddlyWiki

I wonder if, once the Widget Subclassing Mechanism is introduced, perhaps in the next version (5.1.20) - it will be possible to rewrite the appropriate widget for wikitext parsing for headings to add in a unique id attribute for each header, so that something like:

!.#ToC My New First Header

produces HTML similar to:

<h1 class="ToC" id=#SomeUniqueText/Number-BasedOnThe-QualifyMacro+NumberIncrementedForEachHeader> My New First Header</h1>

which could then be used to create a localised tiddler's Table of Contents

Of course this is nonsense - but the bright minds here may begin to be inspired to think about how it can be done.

Cheers!

André Carvalho

ongelezen,
12 apr 2019, 12:53:1012-04-2019
aan TiddlyWiki
Yes David, that's exactly what I have in mind. Thanks.
André

André Carvalho

ongelezen,
12 apr 2019, 12:57:4812-04-2019
aan TiddlyWiki
Thanks Tony.
I don't mind to wait ;) As I said I'm really not a Javascript programmer but I do admire You guys.

André

André Carvalho

ongelezen,
12 apr 2019, 12:59:4812-04-2019
aan tiddl...@googlegroups.com
Thanks for the ideas. I think this is getting pretty close to what I need.
André
Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten