non-case-sensitive links?

130 views
Skip to first unread message

Michael Gentry

unread,
Mar 5, 2018, 11:43:56 AM3/5/18
to TiddlyWiki
I'm looking for a way to make WikiText links case-insensitive, so that, for example, [[worksheet]], [[Worksheet]], [[WorkSheet]], [[WORKSHEET]], and [[wOrKsHeEt]] would all link to the same tiddler "Worksheet". Basically, I want to replicate the effect of the old LooseLinks plugin for TW 2.0 (http://www.TiddlyTools.com/#LooseLinksPlugin).

Has anyone hacked out a solution for this, or perhaps updated the old LooseLinks plugin? Thanks.

Mark S.

unread,
Mar 5, 2018, 12:08:42 PM3/5/18
to TiddlyWiki
I think PMario's uni-link plugin will do that:

Source: https://wikilabs.github.io/editions/uni-link/
Video:  https://youtu.be/V9l-vipAoNw

-- Mark

PMario

unread,
Mar 5, 2018, 1:17:29 PM3/5/18
to tiddl...@googlegroups.com
Hi Michael,

As Mark points out I did a plugin, which may work for your usecase. .. Feedback would be very welcome, if you use the plugin. ... Even if you don't use it, it would be nice to know, if there is something missing.

-m

Michael Gentry

unread,
Mar 5, 2018, 3:13:07 PM3/5/18
to TiddlyWiki
Hi PMario,

Uni-links looks useful but only gets me about halfway there, I think. It looks like in order to make it work universally across a wiki, you'd have to manually add an alias field to every tiddler, which is not feasible in my particular case. (Also I'd want to suppress the "this tiddler has the following aliases" footer.)

The LooseLinks plugin, assuming I'm understanding it correctly, allowed case-folded links to work without requiring any modifications to the target tiddler, and without requiring any different link syntax besides plain double-brackets [[ ]]. It may be that's just not feasible in TiddlyWiki 5.x? 

PMario

unread,
Mar 5, 2018, 5:56:57 PM3/5/18
to TiddlyWiki
On Monday, March 5, 2018 at 9:13:07 PM UTC+1, Michael Gentry wrote:
Uni-links looks useful but only gets me about halfway there, I think. It looks like in order to make it work universally across a wiki, you'd have to manually add an alias field to every tiddler, which is not feasible in my particular case. (Also I'd want to suppress the "this tiddler has the following aliases" footer.)

The footer is configurable.
 
The LooseLinks plugin, assuming I'm understanding it correctly, allowed case-folded links to work without requiring any modifications to the target tiddler, and without requiring any different link syntax besides plain double-brackets [[ ]]. It may be that's just not feasible in TiddlyWiki 5.x? 

It would be a new plugin. ...

In your OP you posted:

[[worksheet]], [[Worksheet]], [[WorkSheet]], [[WORKSHEET]], and [[wOrKsHeEt]] would all link to the same tiddler "Worksheet".

I would immediately ask:

 - Why should the link point to the tiddler: Worksheet and not worksheet?
 - What if both Worksheet and worksheet exist?
 - What if we have [[test]] and [[text]], where only 1 character is different, but both are probably valid? ...
 - How can we detect the "missing tiddler" name. ... It would create 5 missing tiddlers: [[worksheet]], [[Worksheet]], [[WorkSheet]], [[WORKSHEET]], and [[wOrKsHeEt]]

All of those things are different to the default core behaviour. ... So I'm not really convinced.

-m

Michael Gentry

unread,
Mar 5, 2018, 9:25:40 PM3/5/18
to TiddlyWiki


On Monday, March 5, 2018 at 5:56:57 PM UTC-5, PMario wrote:
All of those things are different to the default core behaviour. ... So I'm not really convinced.


That's okay. I'm not asking anyone to whip up a brand-new plugin for me, I'm just wondering if anyone has managed to solve the specific issues I'm dealing with. 

PMario

unread,
Mar 6, 2018, 5:24:13 AM3/6/18
to TiddlyWiki
On Tuesday, March 6, 2018 at 3:25:40 AM UTC+1, Michael Gentry wrote:
That's okay. I'm not asking anyone to whip up a brand-new plugin for me, I'm just wondering if anyone has managed to solve the specific issues I'm dealing with. 

That wouldn't be the problem. ... I'm interested in usecases like this one. That's why I created the uni-link plugin. ...

The problem is, that we would need to answer those questions, to get a consistent set of rules, that can be converted to code.

For the alias functionality, the answer is relatively simple. ...

 - [[worksheet|?]] ... means, this is an alias link
 - Search for every tiddler that has an aliases field,
    - This list is much smaller than the list of all tiddlers.
 - and link those, who contain the word "worksheet" in the aliases field.
 - the alias name "worksheet" is not case sensitive

doing the same for [[worksheet]] ... imo is much harder. ... IMO every step needs to check the whole set of existing tiddlers. ...
I don't see a performant algorithm atm.

Anyway. I will create a feature request in the uni-link repo at github. So it won't be forgotten.

BUT I don't think, that there will be a solution soon. So no promises and no ETA.

So if someone else has a solution, just post here! ... There has been a discussion in 2015 here in the group.

have fun!
mario

Michael Gentry

unread,
Mar 6, 2018, 10:06:59 AM3/6/18
to TiddlyWiki
Cool, thanks. I also found this discussion with the author of LooseLinks (not sure if he's an still active member of this group), back in 2009: https://groups.google.com/d/msg/tiddlywiki/Z-8I6a2MqW4/O0fFputgjvAJ. Although it doesn't specifically address the questions you're raising, maybe there is some insight to be gleaned there.

PMario

unread,
Mar 6, 2018, 10:22:50 AM3/6/18
to TiddlyWiki
On Tuesday, March 6, 2018 at 4:06:59 PM UTC+1, Michael Gentry wrote:
Cool, thanks. I also found this discussion with the author of LooseLinks (not sure if he's an still active member of this group), back in 2009: https://groups.google.com/d/msg/tiddlywiki/Z-8I6a2MqW4/O0fFputgjvAJ. Although it doesn't specifically address the questions you're raising, maybe there is some insight to be gleaned there.

I did have a very short look at the code of the plugin and I think, I know what it does. ... The alias mechanism uses similar functionality. ... But I'm not so happy of creating just an other hash-map to lookup tiddler titles. ... The truth is: ATM I'm not sure what I want :)

-m
Reply all
Reply to author
Forward
0 new messages