Rename a tiddler but keep the links to it

508 views
Skip to first unread message

pseudo Blu

unread,
Oct 4, 2013, 5:32:20 AM10/4/13
to tiddl...@googlegroups.com
Hello,

I've started a Tiddlywiki with tiddlers' titles that are not CamelCase identifers but "small sentences with spaces".

Then, I will link from one tiddler to another but I wonder:

How can I keep the links between tiddlers while being able to rename tiddler's title ?
Since the titles are sentences, I think that I may change them sometimes for a better phrase. But what about all the links to the tiddler ? Is there no way but a manual update one by one ?

Thanks for help

Tobias Beer

unread,
Oct 4, 2013, 1:18:11 PM10/4/13
to tiddl...@googlegroups.com
Hi there,

Not a solution to the problem of updating explicit links or even macro parameters, etc. but a different workflow...
Using it, all tiddler titles become automatically linkified without you needing to type [[some link]] or use CamelCaseWikiWords.

More importantly, it also allows you to define aliases so that whenever you want to link to "foo bar baz mumble frotz gronk", perhaps all you wanted to actually type and link was "foo bar", so your LinkifyConfig would have the following entry...

foo bar baz mumble frotz gronk|foo bar

If you decided to rename it to "fuu bar baz mumble frotz gronk"...

fuu bar baz mumble frotz gronk|foo bar|fuu bar

This wont update your old text, but at least the links will remain working.

To see auto-linkification working, have a look at the new paintr...

I think whenever there will be a RenameWizard type of plugin it will not take long before it ends up in the core because this has been one of the greatest pain points throughout TiddlyWiki's existence.

Tobias.

pseudo Blu

unread,
Oct 7, 2013, 5:27:05 AM10/7/13
to tiddl...@googlegroups.com
Thank you Tobias for the linkify presentation, I've read it up the the key words configuration to understand how it works.
That's a nice pluggin that can be useful in many cases.

However, as you state it, this isn't a solution for this inter-tiddler link and update problem.

What about using a kind of primary key for the tiddlers, and refer to them with this ID ?
To do this I only need to have a hidden title for tiddler (the ID) and a display title (text we are free to update).
The tiddler title would be typed like this (without quotes) : "#1234 | How manage your things" .

B.

Tobias Beer

unread,
Oct 7, 2013, 10:30:02 AM10/7/13
to tiddl...@googlegroups.com
At first I wanted to just jot the idea below. Turns out I have actually developed it right away...

Anyhow, here was / is the idea in detail...

Unique IDs were fine, however they have similar implications and seem a whole lot less intuitive for an end user than the following...

I would opt for appending any previous names to some custom renamed field and then have the internal link handling check for any of those for fallbacks and, when found, display that. This would make old links behave well and be able to open the newly renamed tiddler.

References probably would need some fixing too. In fact, I would want to change the core TiddlyWiki.prototype.reverseLookup so that it it is capable to match an array of lookupValues rather than just one, e.g...

if( values.containsAny(typeof lookupValue == 'object' ? lookupValue : [lookupValue]) ){
    f = lookupMatch;
}

And then I would change TiddlyWiki.prototype.getReferringTiddlers so that it is able to feed reverseLookup not just with the name of the current tiddler but also with its old names. This should probably be the default core handling. I think I will end up making a pull request for that.

The actual handling for oldnames would be a rather straight forward ammendment to TiddlyWiki.prototype.saveTiddler.

While this is probably not something you would not maintain much (i.e. remove old names manually), using custom fields is somewhat difficult as they are so underrepresented (non-editable) in the default ui. So, installing some field editor might perhaps be required as well as well as a custom style or title that slightly differentiates such an outdated link from a proper one.

Eventually I am hoping for some RenameWizard that allows to find all those renamed tiddlers or references in macro parameters, fields, etc...

- tobias

PMario

unread,
Oct 7, 2013, 11:08:12 AM10/7/13
to tiddl...@googlegroups.com
On Monday, October 7, 2013 4:30:02 PM UTC+2, Tobias Beer wrote:
References probably would need some fixing too. In fact, I would want to change the core TiddlyWiki.prototype.reverseLookup so that it it is capable to match an array of lookupValues rather than just one, e.g...

If you hack the core prototype chain, be sure you pass all existing tests.
Every existing plugin has expectations about the core functions ;)

-m

Tobias Beer

unread,
Oct 7, 2013, 12:04:05 PM10/7/13
to tiddl...@googlegroups.com
Hi Mario,
 
If you hack the core prototype chain, be sure you pass all existing tests.

How? I literally have no idea. If you could test that for me or explain the process, that would be grand.

Every existing plugin has expectations about the core functions ;)

I know, I realised that simply overwriting so core functions without hijacking can have nasty side-effects with other plugins who wish to do the same. So either it will get its functionality at the expense of mine or vice versa. So, these are the functions that have not been hijacked...
  • getReferringTiddlers
  • reverseLookup
However, in this case, the only 'better' option would be to hijack all of them and them to pretty much duplicate the code and only run the core stuff when mine doesn't apply. But this isn't good enough either because I might deprive some other plugin whose name is lower in the foodchain from kicking in, i.e. by not running core function it wanted to hijack as well, which I took away. But then, there always is the option to retrofit my plugin or that other one to make both compatible.

Long story short, I think this should definetely end up in one of the next releases of TiddlyWiki classic rather than in a plugin (of mine). Renaming tiddlers has been a pain point like forever.

So, having it out there might perhaps help push the issue, precisely because in the form of a perhaps soonish rather popular plugin it has too much of a potential to cause compatiblility hickups.

So, what do you think, perhaps rather make a new branch "rename tiddlers" and a pull request for core changes? Again, as for (making / writing) tests, I wouldn't know yet.

Tobias.
Reply all
Reply to author
Forward
0 new messages