TonyM,

Okay, I'll explain the problem more clearly:

I would like to write a TableOfContents macro, where the related tags are 
listed alongside the list items itself.


[image: vivaldi_2019-01-04_12-00-41.png]


You can use the list of related tags to narrow the list of tiddlers (for 
example, list only those that are linked to Negatable Operators and Tag 
Operators).

[image: vivaldi_2019-01-04_12-07-22.png]

The current solution works, but it is very slow, because going down the ToC 
level, it is narrowing down the list of tiddlers from level to level 
(`kin::to[Reference]kin::to[Concepts]...`). Instead, I reverse the logic: 
only one of the tiddlers associated with the lowest-level tag is listed, 
which is associated with each of the upstream levels (each of `tag[Tag 
operators]` where all of the upstream tags applies to 
`kin::from<currentTiddler>`).

Since this is a time-consuming operation, I only want to collect the list 
once, but I have to use it in two places: listing the related tags and 
listing the tiddlers themselves. So the logic would be exactly that:

``` 
In the list of tiddlers of current "lowest" tag
   If tiddler fits to each of the "higher" tags
     Add the tiddler to a tiddler list
   end 
end 
List the related tags of tiddler list
List the tiddler list itself
```

Since it's a table of contents, I should not change the tiddlers of the 
list to make them easier to parse (adding some temporary tags). A button + 
<$action-listops is not appropriate because when the user first opens the 
page, no button is pressed, so triggers are not executed.

I think the beginning of the macro should analyze what the current context 
is, collect the tiddlers and store them somehow. That's what I got stuck 
with.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/a83417bb-6080-470d-be18-eeaac931c8f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to