[issue] Quirk in notes database solution I am developing

Thanks @pmario for the ideas within your restructured code and testcase, I was however going to publish it as an exercise or guide to a number of “features” I used in my example. Rather than a complete solution, however there seems to be an interest in a fuller solution using this mechanism, for that I would implement many of your suggestions.

  • Its only weakness I can see is if the tiddler is renamed it will loose access to the note, and Relink does not yet seem to support a title used as the key to a data tiddler.

Jup. I do have a similar function in my script-manager edition, which is my main wiki, that I use every day. It’s basically a “brain dump” with ToDo’s included.

It creates 1 data-tiddler per “script” tiddler. Where every “script” tiddler basically is a “dashboard” itself.

If a new “script” tiddler is created (1) it shows a (2) Created Links Container, for that tiddler. But only the tag matters. So relink can change the tag if the script-title is changed.

The functionality there is not exactly the same as you described, but the whole thing has several step by step videos. — which are quite old (2017) now. But the workflow is the same today as it was then.

The TW code is also from 2017 so it can not be used to demonstrate latest wikitext. I did record some “update” videos, but Youtube got the subtitles completely wrong :confused: (they are not public atm)

I wonder if because relink is so good at what it does we have not explored other opportunities that may help in circumstances like this?

Just before RELINK was made I was asking for a hackable mechanism on rename. The idea would be when saving a tiddler, with a changed title, it would trigger actions on rename found in tiddlers tagged $:/tags/action-on-rename. It would provide old and new names and we can write an action that renamed the key to the note in the data tiddler.

  • Of course this does not capture other forms of rename.
  • What ever updates the modified times stamp, may also be an opportunity to trigger “on modification actions” that designers could add custom actions built into TiddlyWiki scripts, via a system tag, all we need to do is ensure the old and new title is available.
  • If as has being rumoured relink may move to the core, this would be a feature to add if not the actual rename of data tiddler keys that are also titles.

I do not think so. Relink is a huge project on its own and not everyone needs all the possibilities if offers. But I think, we could make the core relinking a bit more intelligent since https://github.com/TiddlyWiki/TiddlyWiki5/pull/8258 is now merged. So the core can now “rebuild” simple wikitext and there should be enough info to handle simple transclusions and links in wikitext.

Tags and list-fields are also updated from the core. So no relink needed.

Sorry but I tried to follow but cant. I do see reference to the undesirable <p></p> tags the transclude index returns, but is this also relevant to rename?

I have written my

Exposé of various methods - Notes on tiddlers stored in a data tiddler

Shall I post it here for peer review, or just publish?

You can publish it under Tips & Tricks. You may make it a wiki. So everyone can improve it.

To change something in wikitext, you need to exactly know where eg: a transclusion starts and ends. Since parsing is expensive and slow for a huge amount of tiddlers, we use the tiddler parse-tree cache for this. The core had start / end info for quite some time, but the API functions to convert a parse-tree back to wikitext was missing. The linked PR has these functions now.

Relink still does much more, but having the basics in the core can help everyone.

Now Published Tips and commentary - Notes on tiddlers stored in a data tiddler

1 Like