roma0104 / gsd5

A Getting-Things-Done tools for the TiddlyWiki5 environment.
MIT License
59 stars 22 forks source link

Preserve inbound references on rename #76

Open edrex opened 8 years ago

edrex commented 8 years ago

Kicking tires. Lots of progress, looking good!

mGSD's tag-based references benefited from some generic tag-enhancing plugins.

One of particular utility (maybe also by @simonbaird, don't quite remember) checked for inbound (tag) references on (tag tiddler) rename, listed referencing tiddlers, and offered to modify the references to preserve integrity.

It would be nice if gsd5's various reference fields had the same integrity-preserving behavior on rename.

Technical question about TW5 data model: Are the reference fields typed as tiddler references, or are they just string fields? If they are/can be typed as references, this could be implemented by iteration over all tiddlers / fields, filtering for reference field instances. Otherwise, a whitelist of known reference fields would have to be maintained, which would be annoying.

Places this has bit me so far, in 10 minutes of testing:

best, Eric

edrex commented 8 years ago

Partially answering my own question about field types, it seems that TW5 fields are untyped (they're all just strings).

In this case, a gsd5-bundled plugin could:

edrex commented 8 years ago

Here's the plugin in mGSD/MPTW: https://github.com/simonbaird/MPTW/blob/master/core/RenameTagsPlugin.js

edrex commented 8 years ago

Probably could be invoked by th-saving-tiddler hook.