Folks,
This is an idea I recently had that brings together concepts discussed in recent weeks, and may be of particular interest to @etardiff and @Springer as it uses backlinks and works for missing tiddlers, and may be an example of another potential “virtual tiddler”, for want of a better name.
- I write this seeking feedback and ideas.
Background
Using tags is a very useful feature of tiddlywiki, but to modify a tag will make a shadow tiddler into a tiddler, make the tiddler appear in recent lists due to modification (unless timestamps are off) and have other impacts. Adding a tag modifies a list of tags on the tags field of each tiddler, for this reason tags will travel with a tiddler imported or exported and transferred to another wiki.
Plugins that wish to alter tags on system or core tiddlers need to replace that core tiddler or get user interaction to add a tag to that tiddler through a trigger and action. This means core system tiddlers are modified and as a result if more than one plugin or package wish to change a tag there is a strong likely hood of a clash.
Proposal introduce a new mechanism called “flags” (working title)
Let me explain how, by way of a description.
Create a tag called flag. Now any tiddler holding that tag will be what we call a flag. For example lets create a tiddler review-flag, and tag it flag.
Now we provide a mechanism on all tiddlers that allows us to assign a flag to any tiddler.
To find all available flags we can list the tiddlers with the “flag” tag.
Once the user selects one of these flags the “current tiddlers title” is appended to the text field of the selected “flag tiddler”, in this case review-flag (note flag need not be in the name, I use it for clarity)
We also have a mechanism to display existing flags on any tiddler
To test for flags we use the current title, and the backlinks mechanism, to find tiddlers that contain a link to this current title.
- We then test each of the resulting titles to see if they also have the “flag” tag, if they do then this is a flag on this tiddler, and we display that flag tiddler title/caption
High hackability
Plugins and other solutions can include one or more tiddlers with the flag tag using a safe title such as $:/plugin/PSaT/flags/review-flag or psat-review-flag containing a list of titles, existing or not, and can be used with any other plugin or solution without clash.
- For documentation or automation this method allows us to flag titles including system tiddlers without touching them.
- Once in place this flag solution can be used with existing system tags to introduce flagged titles in other places such as the view and edit templates and other cascades. The can be displayed and selected as “review” using the caption, and perhaps a tooltip.
- To support ease of use and using existing knowledge of users we could package a range of filter operators by cloning all tag operators, and make flag operators. Also is[flag] and all[flags]
Issues
If this works well I could see this ultimately, perhaps in 5.4.0 TW @jeremyruston replacing the existing tag process for select tags in the system thus improving hackability.
The step I do not know how to implement is how to remove a title from inside the flag tiddlers. Although I know its possible. I suggest a line for each title so we only find/remove a full line at a time.
- Perhaps we could use a dictionary tiddler allowing deletion and have the key = the title, the value = a description/tooltip.
- This may also need a change to allow a data tiddler to also parse to find backlinks.
Futures
Through this mechanism we gain a new type of tiddler role, the flag tiddler, as we have tag tiddlers.
The fact is a flag can be created and assigned to a title even if it does not exist as a title. This introduces the idea of flagging future titles if and when they come to exist, and then responding to the existence of the title.
I believe this would expose other innovative possibilities.
Regards
Tones