Hi! uplight-dev posted a nice way to catch anchor links <https://github.com/Jermolene/TiddlyWiki5/issues/1783> in story.js, and ids can easily added in heading.js <https://tiddlywiki.com/#%24%3A%2Fcore%2Fmodules%2Fparsers%2Fwikiparser%2Frules%2Fheading.js>, so the problem I guess, as mentioned above, is making unique ids. I was wondering if it could be possible to generate ids in heading.js by keeping track of nested headings, say we have a tiddler called "tiddlertitle";
! Header1 <- id = tiddlertitle:Header1 !! Header2 <- id = tiddlertitle:Header1:Header2 !!! Header3 <- id = tiddlertitle:Header1:Header2:Header3 !! Header2b <- id = tiddlertitle:Header1:Header2b !!! Header3 <- id = tiddlertitle:Header1:Header2b:Header3 Can the parser keep track of this, or will it be awfully complicated? It wouldn't guarantee uniqueness, of course, but it could still be useful, especially if transclusions would be treated as "ordinary" tiddler content (inheriting the nesting from the transcluding tiddler). Is the structure of when/how different parts of the wiki/DOM is parsed documented anywhere? Best, Anders torsdag 19. september 2019 kl. 10:48:21 UTC+2 skrev Riz: > Hi Tony, > > Thanks for the reply. You are right, that would not have scaled well. > Plus, we have a solution. Possibly something we can expand upon too! See > above > > Sincerely, > Riz > > On Thursday, 19 September 2019 13:33:38 UTC+5:30, TonyM wrote: >> >> Riz, >> >> I understand. This limitation is really because we have a dynamic HTML >> page here, and the HTML standards did not seem to predict how we can use it >> in tiddlywiki. >> >> One passing thought, what if select tiddlers not already in the "visible" >> story, could be display: none (as opposed to display: hidden) below the >> story and somehow displayed when an anchor to something in them is >> activated. This of course may not scale too well, but may work for a large >> number of cases. Come to think of it tiddlers are in memory anyway, perhaps >> its is not so silly. >> >> Tiddlers to be treated this way could be tagged as such, and those not in >> the current story are "display: None" and once opened and displayed are >> not. In some ways this would be an open tiddler cache and since present on >> the page should be fully addressable with anchors. This could also be used >> to activate on demand stylesheets. >> >> Regards >> Tony >> >> On Thursday, September 19, 2019 at 3:40:20 PM UTC+10, Riz wrote: >>> >>> I am aware of that. However if I recall correctly, >>> 1. it only aids navigation if the link and id exists within same tiddler >>> or >>> will scroll to id if it is already present in storylist. >>> 2. Need to modify ids to fit its unconventional pattern. >>> >>> You see, the code given in my original post already solved the issue of >>> scrolling to an id if it exists in the storylist, without having to >>> modify >>> ids in any manner. My issue was if the id is not present in the story >>> list, >>> it takes 2 clicks to achieve the navigation: first to bring tiddler to >>> storylist, second to scroll. >>> >>> On 19 September 2019 11:02:41 AM TonyM <anthon...@gmail.com> wrote: >>> >>> > If it helps there is prior work on using anchors in tiddlywiki. It >>> relies >>> > on an unconventional use of ## >>> > >>> > Regards >>> > Tont >>> > >>> > -- >>> > You received this message because you are subscribed to a topic in the >>> > Google Groups "TiddlyWikiDev" group. >>> > To unsubscribe from this topic, visit >>> > >>> https://groups.google.com/d/topic/tiddlywikidev/NcCXnZu-OJE/unsubscribe. >>> >>> > To unsubscribe from this group and all its topics, send an email to >>> > tiddly...@googlegroups.com. >>> > To view this discussion on the web visit >>> > >>> https://groups.google.com/d/msgid/tiddlywikidev/7dd87c37-15ad-447d-8316-6db99459c52c%40googlegroups.com. >>> >>> >>> >>> >>> >>> -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikidev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/8e7a0e06-8b8d-435e-8f32-419fb9e9f81bn%40googlegroups.com.