Automatic link outline of a tiddler generated from headings?

183 views
Skip to first unread message

Dave Gifford - http://www.giffmex.org/

unread,
Jan 26, 2019, 6:54:39 PM1/26/19
to TiddlyWiki
Hi all

In StackEdit I really enjoy that it automatically creates an outline from markdown headings # = h1 ## = h2, ## = h3, etc.

See this example of an (experimental) html that I created via Stackedit. http://articulos.giffmex.org/1LDP/apologetica.html

The left outline is automatically generated, and I also duplicated it at the top of the main text section, thinking of mobile users. The lines of the outline are links to the relevant sections.

Most of the discussion on outlines for TW have to do with tagging, understandably. I am wondering if something similar can be done with tiddler markup.

tidtoc (http://tidtoc.tiddlyspot.com/#GettingStarted) is a step towards this. It creates a toc based on TW headers. But the lines of the outline are not links. Could they be?

Even better if a sidebar could show the outline of an open tiddler.

Just curious if this butts up against TW's limits, or if it is just something no one has done before.

Dave

Mark S.

unread,
Jan 27, 2019, 12:31:33 AM1/27/19
to TiddlyWiki
What tiddoc does is use a regular expression filter to extract and then display headers inside a page, and then format them with custom styles.

I'm sure a similar template could be developed that would show links. The problem is ... they wouldn't go anywhere! Regular html links don't work inside of TW, and especially inside of a single tiddler..

This is where the "smallest semantic unit" concept runs against the way most of us work. Oh well.

You could look at the slicer edition to see how a document could be composed of separate tiddlers. Then a TOC macro or a list structure could be used to display a table of contents that could actually link to something.

-- Mark

Diego Mesa

unread,
Jan 27, 2019, 12:51:38 AM1/27/19
to TiddlyWiki
Or, we could revisit previous discussions where we entertained the idea that the smallest semantic unit of knowledge be a field - elevating fields to first class citizens in TW. 

TonyM

unread,
Jan 27, 2019, 2:16:08 AM1/27/19
to tiddl...@googlegroups.com
Lets not go down that field "field" again.

To put it simply if you can get it no other way make them separate tiddlers, however;

Dave, Tell me if I am wrong, you just want to be able to open and close the levels by heading so you can collapse or expand sections as needed. If you have headings in there as organisational structures you want to use them that way?

The example you have given us uses an index and there is no collapsible parts in it. We can already do this with Mark S TWOutlier https://groups.google.com/forum/?hl=en#!topic/tiddlywiki/ol_3zvGPbk8

Speculation: We could provide a toggle, in the view template that folds the tiddler and displays an alternate view of the tiddlers content using a different "pragma" and I believe CSS to open and close. I do not know exactly how, I just think it is achievable.

  • At least I do not see why we cant open and close all h1 h2 h3 levels at once. 
  • In someways this is currently what tiddlywiki does - reads the text, detects markup and translates it to html.
  • But if we can generate html that uses an unique id in each h level we should be able to toggle each heading individually.
  • I believe CSS now has numeric methods just as it can do nth row etc..
  • I wonder why this is not an optional part of the current rendering?, Perhaps it could solve the "link to a place in tiddler" issue, at least in view mode.
  • I think the new in 5.1.18 "Added support for rebasing headings at render time – see tv-adjust-heading-level Variable" may help too.
Regards
Tony

TonyM

unread,
Jan 27, 2019, 2:26:51 AM1/27/19
to TiddlyWiki
Perhaps this can be modified for my above suggestion?

$:/core/modules/parsers/wikiparser/rules/heading.js 

Tony

Dave Gifford - http://www.giffmex.org/

unread,
Jan 27, 2019, 11:31:19 AM1/27/19
to TiddlyWiki
Hi everyone

Thank you for your responses. The link to TWOutlier got me thinking about using it again. So this thread was useful to me. I created a template where I use

1. TWOutwier for my editing area
2. A regular toc-tabbed-internal-nav for the area that users will see online

See http://articulos.giffmex.org/1LDP/2019.agmorg.template.html for my progress so far...see the links to Edit and Web in the sidebar

Dave

HansWobbe

unread,
Jan 27, 2019, 1:34:18 PM1/27/19
to TiddlyWiki
Dave:

This demo was sufficiently interesting for me to spend a bit of time looking at HowToDoIt.  I failed to find out how. 
I know you are busy, but if you have any hints that are somple to share, I'd appreciate them.

Regards,
Hans


Dave Gifford - http://www.giffmex.org/

unread,
Jan 27, 2019, 3:10:31 PM1/27/19
to TiddlyWiki
Hi Hans, happy to help.


1. Web version - is a normal toc-tabbed-internal-nav macro call in the tiddler 'TOPICS (web)', drawing on all tiddlers tagged with that tiddler, and sorting them by sortby.

2. Edit version (tiddler:

$:/.giffmex/Editing HQ)

- uses the TWOutlier plugin (see https://groups.google.com/forum/#!msg/tiddlywiki/ol_3zvGPbk8/2pftgZ86AAAJ). It is a tweaked TOC macro call that grabs the tiddlers tagged with 'TOPICS (web)' but where the tab shows an editable version of the tiddler and a quick way to create new here tiddlers and add a sortby number to qucken sorting of tiddlers in the toc.

3. Fonts: see my stylesheet ($:/.giffmex/Stylesheet/For.publishing) and this tiddler: $:/.stackeditfonts. I really, really like Fira sans and Titillium together. Some tweaks in page control settings, too.

4. Sidebar links: see $:/.giffmex/pagecontrols.links. I untagged $:/core/ui/SideBarSegments/site-subtitle and $:/core/ui/SideBarSegments/site-title to hide the SiteTitle and SiteSubtitle from the sidebar.

5. Theme is Seamless.

Hope that helps! If you have more specific questions on how I did it, I will be happy to help.

Dave

Dave Gifford - http://www.giffmex.org/

unread,
Jan 27, 2019, 3:12:18 PM1/27/19
to TiddlyWiki
Correction: TWOutlier is a macro. It is found in TWOutlier Macros in the All menu, not in the System tiddlers menu where you would expect it.

Dave Gifford - http://www.giffmex.org/

unread,
Jan 27, 2019, 3:16:36 PM1/27/19
to TiddlyWiki
By the way

I just discovered a big boo boo in the tiddler

$:/.giffmex/Editing HQ


It was doing a macro call from a since-deleted tiddler from when I was experimenting. So the tabs were not shoing.

I have corrected and uploaded it to the same link (http://articulos.giffmex.org/1LDP/2019.agmorg.template.html)

Dave

On Sunday, January 27, 2019 at 12:34:18 PM UTC-6, HansWobbe wrote:

Dave Gifford - http://www.giffmex.org/

unread,
Jan 27, 2019, 5:14:26 PM1/27/19
to TiddlyWiki
ok Last post on this for today.

I used the template to start a topic, to work out the kinks in the template. Below is the link. I only have content in the Bienvenido and bibliographies. But the toc is more complete.

TonyM

unread,
Jan 27, 2019, 5:47:23 PM1/27/19
to TiddlyWiki
David,

This kind of alternate view of Tiddlywiki could I believe be called a viewer. Like Jeremys recent thread on  Innerwikis I would like to see a bit of a standard or supporting plugin or macro set, on top of which we build more "viewers" like your own. These would them be readily shareable so the work is done once and then becomes available to every wiki.

TWOutlier was my first inspiration on this. I have spent some time playing with and learning the techniques. One good idea would be to introduce alternate view and edit templates, both inner and outer ones for such viewers. For example TWOutliers "add child" would be in the outer edit template for each tiddler, but inside the viewer. Such view edit templates would have their own toolbars, tags etc... They should also have their own story and history.

Any way just some food for thought since your mind has being on this subject recently.

Regards
Tony

Dave Gifford - http://www.giffmex.org/

unread,
Jan 27, 2019, 6:53:00 PM1/27/19
to TiddlyWiki
Hi Tony

Nice thoughts, or seeds of thoughts...

I confess I didn't take to TWOutlier when it first came out. It was at the same time as a conversation on TW as an outliner, so I was judging it on those merits, and not seeing other possibilities for it. It took until I had been working in StackEdit and really liking the TOC on the side there, and frustrated by StackEdit's limitations in other areas.

Because of StackEdit, I also got more used to the idea of editing while seeing one thing, and creating an end result that looked quite different, and better, than the editor does. So when I looked at TWOutlier again, it had the potential of the TOC I liked from StackEdit, plus it occurred to me, as I doubt it would have before, to do the editing in TWOutlier, and have the web viewer be in a regular vertical TOC tiddler.

TonyM

unread,
Jan 28, 2019, 2:11:06 AM1/28/19
to TiddlyWiki
Dave,

Another trick in a multi screen or large screen environment, is create a Toc Tiddler, and Open it in New Window. Click on a tiddler in the toc window and it will open in the main story. Choose there is its in a view or edit mode.

Regards
Tony
Reply all
Reply to author
Forward
0 new messages