New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meta: Issues with Table of Contents Macros #3627
Comments
Hi @pmario , @Jermolene ... I'd like to add a short piece of code here that comes from a short discussion in the group and looked very interesting to me, I was thinking that this could be a fast way to create toc-structures (I've changed it a bit to be two-level, but like the
|
Hi @BurningTreeC does that code work with titles that contain wikitext (e.g. |
@Jermolene no it doesn't I hadn't checked that ... |
Hi @BurningTreeC I've seen similar constructions on the mailing list, but I don't know where the idea of using the wikify widget to compose filter strings came from; it's a terrible idea! Do please help spread the word if you see it being recommended anywhere. |
It was more the structure how it was created that looked interesting... getting the whole list at start, using it again and again I thought maybe the button and reveal structures could also be wikified at the start and then be reused over and over again |
Absolutely, yes -- that was the motivation of the 'enlist' operator... |
Well then I need to be schooled, too 😁 I'll help spreading the info, but I think I'll need to get it better, too |
Here I don't want to go too much off-topic with the wikify widget... I'll make an issue that it needs some very clear statements in the docs for what it's designed for ... and for what NOT (or better not) |
Great idea, thanks @BurningTreeC -- @bimlas made a PR but I think we probably need to start again. |
Ok, for the toc-macros, can we define the most basic recursive structure we'd use to build upon? |
(... is that english? 😄 ) |
Yes. I do wonder if it might be worth building a little performance test rig for this, running under Node.js so that we can also readily measure memory consumption too. I don't think there's much to it: we can use the existing |
that's what I had in mind, too ... creating different variants to see which works best do you have a simple structure you would consider the base for all or should we just gather some ideas? |
I've no fixed ideas beyond what we've discussed already, and the thought that it is the additional processing to generate state tiddlers that seems to be the troublesome part of what we've got. |
I think the first thing we can do on the current toc macro is to qualify only once before starting the recursion because the qualified value is always the same |
basically:
sorry for the bump! |
It might be another issue, but it's about the table of contents, so I'll mention it here: I'm thinking of implementing a different kind of ToC macro, which displays the related tags beside the children of the current "level", so it can be much more "natural" to navigate in the table of contents. In addition, instead of the tree structure, it only displays a "level" at a time: in fact, people just interpret one "topic" at one time, unable to read each level at the same time, but only the current block. The problem is that people are accustomed to the ToC structure of a printed book and a really "digital" table of contents is hard to get used to. So we are forced into a solution that makes it more limited to actually utilizing useful implementations. Here is the demo that is still under development and is currently a bit slow: scroll to the "View of context - a more sophisticated toc macro powered by |
Updated the demo: try the standard search too: it will look only in the current context. In my opinion, the term "all-in-one" can be interpreted as follows as well: you have one mind where you have all the information, no separate compartments where you store the different topics, only the context differs in the sense in which you mean a word or concept. Based on these, a single wiki is enough to store your programming notes, reader logs, todo lists, anything, if you do not want to search the whole "brain", you can narrow your search to the topic you want. @Jermolene What do you think? |
Hi @bimlas that's great, exploring more complex ways of slicing and dicing linked data like this is fascinating. I don't think I fully understand what it's doing, though; it is very cryptic at the moment. Anyhow, this sort of thing belongs in a plugin, at least in the early days. |
Could add this as well if it's relevant: #3675 |
The code has evolved into a separate plugin: https://bimlas.gitlab.io/tw5-locator |
At the moment I'm fixing the core TOC macros and add some cool stuff ;) So don't mess with it! |
@pmario Great to hear that!! |
Just as an aside, I think one of the big problems with the TOC macros is that we've loaded too many features. For instance, the ability to suppress a TOC link runs through the code, and yet seems to me to be a far from universal requirement. I'd much rather we kept the existing macros as simple and streamlined as possible, moving any new features that impact performance into separate TOC variants. |
That's right. eg: "Tabbed Internal" and "Tabbed External" use the TOC macros, but also have their own "story". ... But the story handling doesn't use the existing core possibilities. So it creates an overhead, which actually limits the functionality and causes problems. I think I found a solution here, which should make the whole thing much cleaner. |
We got the biggest performance hit AND functionality regression, with using Related problems can be seen here Using I'll post a link to a test version soon. ... Today if everything goes right. |
Hi folks, Please test: toc-refactored-wip.zip Here's a video, that shows what's new. PR will follow soon. |
Source code can be seen with the above "WIP TOC refactor" link #3939 |
Close this one, since it is discussed with PR now. |
Proposal to have a closer look at the TOC macros
path
anditemClassFilter
from<<toc-body>>
macro.path
construction, since new code doesn't do, what it is supposed to do.<<qualify>>
macro and not how thepath
variable was constructedtoc-item
-toc-item-selected
class assignmentexclude
parameter usableThe text was updated successfully, but these errors were encountered: