TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.04k stars 1.19k forks source link

[IDEA] backlinks operator should be able to find links from shadow tiddlers #5594

Open Jermolene opened 3 years ago

Jermolene commented 3 years ago

The backlinks operator currently only looks for links from ordinary tiddlers to the target tiddlers.

It would be useful to add an option to be able to include some or all shadow tiddlers. This would enable documentation shipped as a plugin to be navigated via backlinks.

The problem is really that the backlinks operator has things the wrong way round: instead of finding links to the input tiddlers it should have searched the input tiddlers to find links to the tiddler named in the operand.

It's too late to change how the backlinks operator works, so we'll have to come up with a new name for this variant:

[[$:/core]plugintiddlers[]linkbacks<currentTiddler>]
pmario commented 3 years ago

[[$:/core]plugintiddlers[]linkbacks<currentTiddler>] I'm not happy with the name "linkbacks". It doesn't feel right and it doesn't say, what it is used for.

The backlinks[] operator doesn't use a parameter atm. It may be possible to use the same mechanism as the all[] operator

eg: [[HelloThere]backlinks[shadows+tiddlers]] where the default is tiddlers

Possible parameters may be: tiddlers, shadows, tiddlers+shadows and shadows+tiddlers

pmario commented 3 years ago

You did mention, that there may be a performance problem, since empty already has several 1000 tiddlers. But shadows aren't changed that often, So the "cache" could be precompiled so we don't have any startup penalty.

The second possibility would be to "namespace" the shadow backlinks. eg: [[test]backlinks[tiddlers+$:/plugins/wikilabs/content+$:/whatever]]

This will give us the possibility to keep all caches except the one that is changed