Links to tiddlers irrespective of capitalization

61 views
Skip to first unread message

Jason

unread,
Aug 3, 2009, 6:56:48 AM8/3/09
to TiddlyWiki
Hello everybody,

does anyone know of a method to link to a tiddler without having to
care about the capitalization? I searched the web, but could not find
what I am looking for.

As an example:
If I have a tiddler with title "Example" I would like to be able to
link to it with lower case in a text just via [[example]] instead of
[[example|Example]].
This would also solve the problem that renaming the tiddler from
"Example" to "example" would not require to change all the links.

Any suggestion would be very much appreciated!
Regards,
Jason

Eric Shulman

unread,
Aug 3, 2009, 7:28:27 AM8/3/09
to TiddlyWiki
> does anyone know of a method to link to a tiddler without having to
> care about the capitalization? I searched the web, but could not find
> what I am looking for.

http://www.TiddlyTools.com/#LooseLinksPlugin

does *exactly* what you want!

enjoy,
-e

Jar

unread,
Aug 3, 2009, 11:18:40 AM8/3/09
to TiddlyWiki
Thanks, exactly what I needed... I think it should be in the core
(after all it is extremely small).
As a starter with TiddlyWiki it is very annoying that you have to use
[[example|Example]] to write correctly.

Jeroen

wolfgang

unread,
Aug 3, 2009, 11:39:09 AM8/3/09
to TiddlyWiki
> ... I think it should be in the core
> (after all it is extremely small).
> As a starter with TiddlyWiki it is very annoying that you have to use
> [[example|Example]] to write correctly.
>

Don't think so. I tried LooseLinksPlugin with a very large TiddlyWiki,
and there it isn't practical, since it slows performance badly.

Regards..

Jar

unread,
Aug 3, 2009, 1:42:31 PM8/3/09
to TiddlyWiki

> Don't think so. I tried LooseLinksPlugin with a very large TiddlyWiki,
> and there it isn't practical, since it slows performance badly.
>
> Regards..

Off course it should be an option to activate or not (much like it is
now). But I only think that people starting with TiddlyWiki an people
with relative small files, will appreciate the more natural way of
linking ...

May I ask how large your TW file is that it had such an impact ... ?
Size is relative :-)

Jeroen

Eric Shulman

unread,
Aug 3, 2009, 3:27:06 PM8/3/09
to TiddlyWiki
> Don't think so. I tried LooseLinksPlugin with a very large TiddlyWiki,
> and there it isn't practical, since it slows performance badly.

I've just done a major performance re-write for LooseLinksPlugin...
instead of looping through all the tiddlers each time a TiddlyLink is
rendered, it now builds and caches an associative array 'map' that
casefolds/spacefolds all tiddler names only once, during startup, and
then updates single entries as tiddlers are added, renamed, or
deleted.

As a result of this map, when a TiddlyLink is rendered, there is no
longer any looping at all... the requested tiddler title is simply
case/space folded and then used as an index into the cached map to get
the 'real' tiddler title.

Note: although the map is now generated during startup, it actually
creates a net *decrease* in startup time because the new code only
performs the loop once, on demand, and caches the result, while the
previous looping code was being invoked numerous times, once for each
TiddlyLink rendered in the initial document content.

Get the update (v1.1.0) here:
http://www.TiddlyTools.com/#LooseLinksPlugin

Wolfgang: please try this with one of your jumbo TWs and get some
comparison performance metrics... thanks.

enjoy,
-e

Jar

unread,
Aug 3, 2009, 4:17:10 PM8/3/09
to TiddlyWiki
Just for your information.

When I create a tiddler [[PRHC]] and I add to the DefaultTiddler
tiddler a link to [[prhc]] then it links to an empty tiddler with the
name "prhc". Using it in 'normal' tiddlers works fine so not a big
problem, just wanted to let you know.

Jeroen

Eric Shulman

unread,
Aug 3, 2009, 5:26:20 PM8/3/09
to TiddlyWiki
> When I create a tiddler [[PRHC]] and I add to the DefaultTiddler
> tiddler a link to [[prhc]] then it links to an empty tiddler with the
> name "prhc". Using it in 'normal' tiddlers works fine so not a big
> problem, just wanted to let you know.

LooseLinksPlugin only extends the handling for TiddlyLinks. It does
not affect any other use of tiddler names, such as references in
DefaultTiddlers, or use as macro parameters (e.g., <<tiddler prhc>>).

-e

Jason

unread,
Aug 4, 2009, 3:54:32 AM8/4/09
to TiddlyWiki
Thanks Eric, Wolfgang and Jeroen for all the information!
Eric, your plugin is really exactly what I was looking for, thank you
very much!!
Regards,
Jason

Jason

unread,
Aug 4, 2009, 5:33:46 AM8/4/09
to TiddlyWiki
Oh, one more question: Is there any way to get the references
ToolbarButton to work with LooseLinks?
(Such that also "[[example]]" is counted as a reference to the tiddler
with title "Example"?)
Jason

M)

unread,
Aug 6, 2009, 12:00:50 AM8/6/09
to TiddlyWiki
I imagine there is a way to replace the "references" with some other
label like "see also" that lists all the tiddlers that have the title
in the body of the tiddler. The http://www.tiddlytools.com/#SearchOptionsPlugin
provides the capability. Eric must know how to do it (not me). You
can add something like this to the ViewTemplate for the short term:

<span macro='search {{tiddler ? tiddler.title : ""}} "see also: " ",
"'></span>

M)

Jason

unread,
Aug 7, 2009, 8:37:39 AM8/7/09
to TiddlyWiki
Thanks for the suggestion, M. With the SearchOptionsPlugin it works
fine (although it's a pity to have to dismiss the very nice
YourSearchPlugin). Actually I even prefer to have the list of
"referring tiddlers" displayed at the bottom of every tiddler very
much like your code suggestion

<span macro='search {{tiddler ? tiddler.title : ""}} "see also: " ",
"'></span>

My only worry is that this list might blow up very fast as the TW is
getting bigger. In combination with the LooseLinksPlugin it would be
great to have an additional option for the search macro like "search
in the text of links only";
such that a word like "searchword" is found only in tiddlers with
links like [[Searchword Tiddler]] in it and not in tiddlers with "..
some irrelevant use of the word searchword..." in the text.
Jason
Reply all
Reply to author
Forward
0 new messages