Rename/Refactor Tiddlers

108 views
Skip to first unread message

O. Olson

unread,
Aug 7, 2007, 9:20:06 AM8/7/07
to TiddlyWiki

Hi,
I've been using TiddlyWiki for some time now - but I still do not
have much knowledge about it.

I would like to know if it is possible to rename a Tiddler and at the
same time update the name in all Tiddlers that refer to this renamed
Tiddler.

For example:

Consider Tiddler A is mentioned or referenced in Tiddlers B and C.
Suppose I change Tiddler A's name to Z. Then the references in
Tiddlers B and C should now point to Tiddler Z.

This is similar to refactoring programming code (such as what Eclipse
allows you to do in Java.)

I hope this explanation is clear.

Thanks to anyone who has ideas,
O.O.

wolfgang

unread,
Aug 7, 2007, 12:04:44 PM8/7/07
to TiddlyWiki
Guess if I would want to change the name of a tiddler and all links to
it, I would simply open the TiddlyWiki in an editor, search and simply
replace each instance of that particular tiddler title.

That's pretty simple, fast and does the job,

Regards,

W

O. Olson

unread,
Aug 7, 2007, 12:19:16 PM8/7/07
to TiddlyWiki
Thanks Wolfgang - but isn't there a better way.

Your "search and replace" may not be as easy as you think - because
every instance of that name does not mean a link to the renamed
Tiddler.
O.O.

Ken Girard

unread,
Aug 7, 2007, 1:03:20 PM8/7/07
to TiddlyWiki
Search is not limited to just links. It also reads text, tags, titles.
So if you do a search for "Foo" it should bring up every tiddler with
"Foo" in it (Unless they are tagged 'excludeSearch'), which also means
every tiddler with "Food" and "fool" in them.

There is a plugin which will change all occurances of a tag (?
RenameTags?), and I think links, but not one that will change standard
text.

Ken Girard

> > W- Hide quoted text -
>
> - Show quoted text -

O. Olson

unread,
Aug 7, 2007, 5:41:53 PM8/7/07
to TiddlyWiki
Dear Ken,

I think you misunderstood Wolfgang's post. He was referring to
editing the Wiki in a plain text editor.

As regards to your suggestion of using the search within the Wiki - I
don't think that's feasible for me. (Because my Wiki takes too long
for the Search.)

I actually, do not want to change standard text. I wanted change
names of Tiddlers and their references.

E.g.

TiddlerName: Food
Some description that follows ............

TiddlerName: Carrot
Some description ...............
............ See also [[Food]]


Here we have the Tiddler "Food" being referenced in Tiddler "Carrot".
Now suppose if I wanted to change the name of Tiddler "Food" to "Food
- General." I would now want the reference in Tiddler "Carrot" to
still continue pointing to "Food - General."

Is there a way to achieve this?

Thanks a lot,
O.O.

Ken Girard

unread,
Aug 7, 2007, 10:51:46 PM8/7/07
to TiddlyWiki
Yep, I misread it.

Here is the RenameTagsPlugin (http://mptw.tiddlyspot.com/
#RenameTagsPlugin) which does what you want, except with tags, not
links. If nothing else it is a place to start.

Also have you looked at Udo's YourSearchPlugin (http://
tiddlywiki.abego-software.de/#YourSearchPlugin)? It is a better search
system then the basic system.

Ken Girard

wolfgang

unread,
Aug 7, 2007, 11:44:10 PM8/7/07
to TiddlyWiki
Yes, I was referring to a search and replace with an external editor.
Actually I did it this way, when I wanted to have only certain words
translated in my TiddlyWiki, and I still reckon my method quicker and
faster. As in your example: 'Food' would only occur maybe 20-40 times
and, after a short glance, click at each occurance 'replace' or
'cancel' - than waiting for a Plugin developed specific for this
purpose.

'YourSearch' of Udo is as good, compared to the native search of a
TiddlyWiki, I would not want to do without. Though to replace a
certain word would be much more complicated than with an external
editor, too.

Haven't took a close look at http://www.tiddlytools.com/#AliasPlugin
yet. But I think if you knew beforehand that at one point you would
want to change certain links expression - maybe this Plugin could do
it then?

Wait a minute, just remembered http://weave.tiddlyspot.com/index.html#AutoWeavePlugin
That would definitely change any word in any tiddler to link to a
changed title of an other tiddler. However, here too you would have to
open each Tiddler where you suspect such a word, and save it anew, to
let AutoWeavePlugin do it's job. But you better don't have no other
macros inside those tiddler, because AutoWeave doesn't recognize them,
and by placing double braces into them, makes them no more
functioning.

Guess my initial suggestion would be still more efficient in most
cases than any of this other Plugins.

Regards,

W.

Simon Baird

unread,
Aug 8, 2007, 8:52:32 AM8/8/07
to Tiddl...@googlegroups.com
Inspired by this thread I have updated RenameTagsPlugin to also attempt to rename links in other tiddlers.

It's experimental I guess only because I've not tested it much. Try it out here if you're interested:
http://mptw.tiddlyspot.com/sandbox.html#RenameTagsPlugin

Simon.

On 8/8/07, O. Olson <olso...@yahoo.it> wrote:

Dear Ken,


        I actually, do not want to change standard text. I wanted change
names of Tiddlers and their references.

E.g.

TiddlerName: Food
Some description that follows ............

TiddlerName: Carrot
Some description ...............
............ See also [[Food]]





--
simon...@gmail.com

Ken Girard

unread,
Aug 8, 2007, 1:24:46 PM8/8/07
to TiddlyWiki
I am happy to report it seems to work in IE6.
And now more then ever tags, tiddlers, and links are all the same
thing.

Ken Girard

On Aug 8, 7:52 am, "Simon Baird" <simon.ba...@gmail.com> wrote:
> Inspired by this thread I have updated RenameTagsPlugin to also attempt to
> rename links in other tiddlers.
>
> It's experimental I guess only because I've not tested it much. Try it out
> here if you're interested:http://mptw.tiddlyspot.com/sandbox.html#RenameTagsPlugin
>
> Simon.
>

> On 8/8/07, O. Olson <olson_...@yahoo.it> wrote:
>
>
>
>
>
>
>
> > Dear Ken,
>
> > I actually, do not want to change standard text. I wanted change
> > names of Tiddlers and their references.
>
> > E.g.
>
> > TiddlerName: Food
> > Some description that follows ............
>
> > TiddlerName: Carrot
> > Some description ...............
> > ............ See also [[Food]]
>
> --

> simon.ba...@gmail.com- Hide quoted text -

Saq Imtiaz

unread,
Aug 8, 2007, 1:29:26 PM8/8/07
to Tiddl...@googlegroups.com


On 8/8/07, Simon Baird <simon...@gmail.com> wrote:
Inspired by this thread....

Oh really, you wouldnt say? :)
 

O. Olson

unread,
Aug 8, 2007, 2:13:12 PM8/8/07
to TiddlyWiki
Thanks Ken.

On Aug 8, 4:51 am, Ken Girard <ken.gir...@gmail.com> wrote:
> Also have you looked at Udo's YourSearchPlugin (http://
> tiddlywiki.abego-software.de/#YourSearchPlugin)? It is a better search
> system then the basic system.
>
> Ken Girard
>

I think you just answered my next thread to the Group. I have a big
problem with the Search as my Wiki has grown too big - and the
"searching as you type" does not work for me. I would take a look at
Udo's plugin.

Regards,
O.O.

O. Olson

unread,
Aug 8, 2007, 2:15:09 PM8/8/07
to TiddlyWiki

On Aug 8, 5:44 am, wolfgang <wolfgangl...@gmail.com> wrote:
> 'YourSearch' of Udo is as good, compared to the native search of a
> TiddlyWiki, I would not want to do without. Though to replace a
> certain word would be much more complicated than with an external
> editor, too.
>

> Haven't took a close look athttp://www.tiddlytools.com/#AliasPlugin


> yet. But I think if you knew beforehand that at one point you would
> want to change certain links expression - maybe this Plugin could do
> it then?
>

> Wait a minute, just rememberedhttp://weave.tiddlyspot.com/index.html#AutoWeavePlugin


> That would definitely change any word in any tiddler to link to a
> changed title of an other tiddler. However, here too you would have to
> open each Tiddler where you suspect such a word, and save it anew, to
> let AutoWeavePlugin do it's job. But you better don't have no other
> macros inside those tiddler, because AutoWeave doesn't recognize them,
> and by placing double braces into them, makes them no more
> functioning.
>
> Guess my initial suggestion would be still more efficient in most
> cases than any of this other Plugins.
>
> Regards,
>

Dear Wolfgang,

Thanks for your suggestions. I do not want to consider editing many
Tiddlers in the Wiki by hand at the same time - as it has grown too
big (at least for my computer.) I would take at the plugins you
mentioned.

Thanks again,
O.O.


> W.
>

O. Olson

unread,
Aug 8, 2007, 2:21:53 PM8/8/07
to TiddlyWiki
Dear Simon,

Thanks for taking the trouble to get this. I think I cannot import
that Plugin.

Before anything else I should mention that I started using the Wiki
in the beginning of March 2007. I have not added any Plugins and have
not updated the core of my Wiki since then.

Now, I tried to "Import tiddlers". In "Step 1" I type the location
that you provided. "Step 2" seems Ok. However in "Step 3" there does
not seem to be anything in the table. Just the title row of the table
i.e. a check box, the Title, Snippet, and Tags.

I am using FireFox 2.0.0.6

Please let me know if I am doing something wrong - or if you need any
more information.

Thanks again,
O.O.

Ken Girard

unread,
Aug 8, 2007, 4:18:51 PM8/8/07
to TiddlyWiki
OK, Simon, I think the new RenameTagsPlugin might work a little too
well.

I used my customized <<newTiddler label:'Add a NewTrainer' tag:trainer
title:'NewTrainer'>> button and when I went to save the tiddler it
asked if I wanted to update the link in one tiddler. Being curious I
said yes, and wound up with a <<newTiddler label:'Add a [[Michael
Sands]]' tag:trainer title:'[[Michael Sands]]'>> button.

I am still at work, so I am using TW 2.1.3 in IE6.

Ken Girard


On Aug 8, 7:52 am, "Simon Baird" <simon.ba...@gmail.com> wrote:

> Inspired by this thread I have updated RenameTagsPlugin to also attempt to
> rename links in other tiddlers.
>
> It's experimental I guess only because I've not tested it much. Try it out
> here if you're interested:http://mptw.tiddlyspot.com/sandbox.html#RenameTagsPlugin
>
> Simon.
>

> On 8/8/07, O. Olson <olson_...@yahoo.it> wrote:
>
>
>
>
>
>
>
> > Dear Ken,
>
> > I actually, do not want to change standard text. I wanted change
> > names of Tiddlers and their references.
>
> > E.g.
>
> > TiddlerName: Food
> > Some description that follows ............
>
> > TiddlerName: Carrot
> > Some description ...............
> > ............ See also [[Food]]
>
> --

> simon.ba...@gmail.com- Hide quoted text -

Ken Girard

unread,
Aug 8, 2007, 4:30:26 PM8/8/07
to TiddlyWiki
Check the box next to the tiddler title you want to import (I strongly
recomend not importing more then one plugin at a time. I've had
oddness come out of that) and then choose "Import these Tiddlers" in
the select box at the bottom.

Ken Girard

> > Simon.- Hide quoted text -

Simon Baird

unread,
Aug 8, 2007, 7:33:00 PM8/8/07
to Tiddl...@googlegroups.com
okay, by this thread and some friendly encouragment/technical assistance/pleading from Saq... :)

 


--
simon...@gmail.com

O. Olson

unread,
Aug 8, 2007, 8:25:17 PM8/8/07
to TiddlyWiki
Dear Ken,

You are suggesting that there is a list of Tiddlers and that I should
choose one. (I know this, because I have done this 6 months ago.)

However, now I am not getting this list. I am simply getting the
Table, without any entries i.e. no Tiddlers when I connect to that
page: http://mptw.tiddlyspot.com/sandbox.html

I don't know what I am doing wrong.
O.O.

Simon Baird

unread,
Aug 8, 2007, 9:32:39 PM8/8/07
to Tiddl...@googlegroups.com
On 8/9/07, O. Olson <olso...@yahoo.it> wrote:

       Thanks for taking the trouble to get this. I think I cannot import
that Plugin.

       Before anything else I should mention that I started using the Wiki
in the beginning of March 2007. I have not added any Plugins and have
not updated the core of my Wiki since then.
 
My guess is that a 2.1 TW can't import from a 2.2 TW.
 
You probably are going to have to install the Plugin the old fashioned way. See here:
 
Simon.

 



--
simon...@gmail.com

Simon Baird

unread,
Aug 8, 2007, 9:53:25 PM8/8/07
to Tiddl...@googlegroups.com
On 8/9/07, Ken Girard <ken.g...@gmail.com> wrote:
>
> OK, Simon, I think the new RenameTagsPlugin might work a little too
> well.
>
> I used my customized <<newTiddler label:'Add a NewTrainer' tag:trainer
> title:'NewTrainer'>> button and when I went to save the tiddler it
> asked if I wanted to update the link in one tiddler. Being curious I
> said yes, and wound up with a <<newTiddler label:'Add a [[Michael
> Sands]]' tag:trainer title:'[[Michael Sands]]'>> button.
>
> I am still at work, so I am using TW 2.1.3 in IE6.

Darn, I thought something like that might happen. I don't know a easy solution for this. I'm doing a simple replace which isn't clever enough to realise this one shouldn't be replaced. I expect there is a level 40 regexp that can solve the problem but it's beyond my meagre powers. Anyone like to help?, the code looks like this:

var content = t.text;
if (oldTag.match(config.textPrimitives.wikiLink)) {
  if (newTag.match(config.textPrimitives.wikiLink)) {
    content = content.replace(new RegExp("\\b"+oldTag+"\\b","mg"),newTag);
  }
  else {
    content = content.replace(new RegExp("\\b"+oldTag+"\\b","mg"),"[["+newTag+"]]");
  }
}
else {
  content = content.replace(new RegExp("\\[\\["+oldTag+"\\]\\]","mg"),"[["+newTag+"]]");
  content = content.replace(new RegExp("\\|"+oldTag+"\\]\\]","mg"),"|"+newTag+"]]");
}

--
simon...@gmail.com
 

Eric Shulman

unread,
Aug 8, 2007, 11:16:41 PM8/8/07
to TiddlyWiki
> My guess is that a 2.1 TW can't import from a 2.2 TW.

That's correct. It is because the TW2.2 file format changed in such a
way that the old import can't find the new location of the storeArea
DIV, thus no tiddlers appear in the list.

> You probably are going to have to install the Plugin the old fashioned way.
> See here:http://www.tiddlywiki.org/wiki/How_do_I_install_a_plugin%3F

Try installing both these plugins
http://www.TiddlyTools.com/#ImportTiddlersPlugin
AND
http://www.TiddlyTools.com/#ImportTiddlersPluginPatch

HTH,
-e

O. Olson

unread,
Aug 9, 2007, 8:35:11 AM8/9/07
to TiddlyWiki

On Aug 9, 3:32 am, "Simon Baird" <simon.ba...@gmail.com> wrote:
> My guess is that a 2.1 TW can't import from a 2.2 TW.
>
> You probably are going to have to install the Plugin the old fashioned way.
> See here:http://www.tiddlywiki.org/wiki/How_do_I_install_a_plugin%3F
>
> Simon.
>

Dear Simon,

I installed your Plugin, and it shows up in the "PluginManager" - but
I could not figure out how to use it.
Can you post some link to some documentation regarding this.

Also, can someone post a link to some instructions on how to update
TW2.1 to TW2.2. I tried searching for this information in this group
using "update TW2.2" - and I got nothing. I searched in the Wiki and I
only got http://www.tiddlywiki.org/wiki/Upgrading_your_TiddlyWiki_to_2.1.x
- there is nothing regarding 2.1 to 2.2.

Thanks a lot,
O.O.

Ken Girard

unread,
Aug 9, 2007, 2:31:29 PM8/9/07
to TiddlyWiki
If you mean the RenameTagsPlugin all you have to do to use it once it
is installed is to change a tiddler title, then click done. If it has
any links that point to it you will get a pop-up message asking if you
want to change the links, and if the title is also used as a tag you
will be asked if you want to change the tags.

Example:
You have the tag 'school' in your blog tiddlers.
You also have links in your ToDo list that point at the 'school'
tiddler where you have information about the high school you attend.
Click on the 'school' tag in one of the tiddlers.
This will open a tiddler titled 'school'.
Click on edit and change it to 'high school' and then click done.
You will get the two pop-up messages, and if you said yes, then all
the links and tags in that TW that said 'school' will now say 'high
school'.

Now you can create a new tiddler/tag titled 'college' to talk about
that part of your life.

Ken Girard

On Aug 9, 7:35 am, "O. Olson" <olson_...@yahoo.it> wrote:
> On Aug 9, 3:32 am, "Simon Baird" <simon.ba...@gmail.com> wrote:
>
> > My guess is that a 2.1 TW can't import from a 2.2 TW.
>
> > You probably are going to have to install the Plugin the old fashioned way.
> > See here:http://www.tiddlywiki.org/wiki/How_do_I_install_a_plugin%3F
>
> > Simon.
>
> Dear Simon,
>
> I installed your Plugin, and it shows up in the "PluginManager" - but
> I could not figure out how to use it.
> Can you post some link to some documentation regarding this.
>
> Also, can someone post a link to some instructions on how to update
> TW2.1 to TW2.2. I tried searching for this information in this group
> using "update TW2.2" - and I got nothing. I searched in the Wiki and I

> only gothttp://www.tiddlywiki.org/wiki/Upgrading_your_TiddlyWiki_to_2.1.x

O. Olson

unread,
Aug 9, 2007, 4:50:05 PM8/9/07
to TiddlyWiki
Dear Ken,

Thanks for your information. I think this is exactly what I wanted.
This seems to take a bit longer for a replacement - but I can live
with that.
I hope that when this Plugin matures someone could include what you
just posted - for the benefit of other users.

Thanks again,
O.O.

O. Olson

unread,
Aug 9, 2007, 4:52:17 PM8/9/07
to TiddlyWiki
Dear Ken,

Thanks for your suggesting Udo's Plugin - it is awesome and does not
take much resources. The Basic search for me used to take about 10
secs or more if I mistakenly typed something too common.

O.O.


On Aug 8, 4:51 am, Ken Girard <ken.gir...@gmail.com> wrote:

O. Olson

unread,
Aug 9, 2007, 5:02:45 PM8/9/07
to TiddlyWiki
On Aug 9, 3:32 am, "Simon Baird" <simon.ba...@gmail.com> wrote:
>
> My guess is that a 2.1 TW can't import from a 2.2 TW.
>
> You probably are going to have to install the Plugin the old fashioned way.
> See here:http://www.tiddlywiki.org/wiki/How_do_I_install_a_plugin%3F
>
> Simon.
>

Dear Simon,

Thank you for this Plugin. I think I got it to work. I would like to
point out that sometimes the Plugin screws up and creates a slight
(though obvious) errors. This never happens when you use it the first
time after the Wiki starts - but the second time when you call it this
happens.

Consider:

TiddlerName: A link to Dog Food
TiddlerText: Link: [[Dog Food]]

TiddlerName: Dog Food
TiddlerText: Type the text for 'Dog Food'

Now change: "Dog Food => DogFood" in the Title of the Second Tiddler
and then a little later back again to "DogFood => Dog Food" Ensure
that you do not close the Wiki between these two attempts.

As mentioned above, the first attempt would be correct, and every odd
attempt would be correct. However for the second and every even
numbered attempt you would get something like

TiddlerName: A link to Dog Food
TiddlerText: Link: [[[[Dog Food]]]]

I should mention that I have TW2.1 and not TW2.2.

I can live with this - but if you manage to correct this let me know.

Thanks again,
O.O.

Simon Baird

unread,
Aug 9, 2007, 7:36:26 PM8/9/07
to Tiddl...@googlegroups.com
On 8/10/07, O. Olson <olso...@yahoo.it> wrote:


Dear Simon,


As mentioned above, the first attempt would be correct, and every odd
attempt would be correct. However for the second and every even
numbered attempt you would get something like

TiddlerName: A link to Dog Food
TiddlerText: Link: [[[[Dog Food]]]]
 
I can live with this - but if you manage to correct this let me know.

Thanks very much for the excellent bug report. I have made a fixed version, you can get it here:

http://mptw.tiddlyspot.com/sandbox.html#RenameTagsPlugin

(Though it still has the problems that Ken discovered).

Regards,

Simon.


--
simon...@gmail.com

O. Olson

unread,
Aug 11, 2007, 4:42:16 AM8/11/07
to TiddlyWiki
On Aug 10, 1:36 am, "Simon Baird" <simon.ba...@gmail.com> wrote:
>
> Thanks very much for the excellent bug report. I have made a fixed version,
> you can get it here:
>
> http://mptw.tiddlyspot.com/sandbox.html#RenameTagsPlugin
>
> (Though it still has the problems that Ken discovered).
>

Dear Simon,

I think I am still having this bug. I updated my Pulgin to Rev: 1845
- and I tested it in FireFox 2.0.0.6 and the behavior/bug is still
there.

I could not access this thread for some reason the entire day
yesterday.
Thanks a lot.
O.O.

Reply all
Reply to author
Forward
0 new messages