Unilink and my possibly unrealistic wants...

437 views
Skip to first unread message

Ste Wilson

unread,
Mar 5, 2019, 12:40:38 PM3/5/19
to TiddlyWiki
I gave the unilink plugin a try today and if I were starting my wiki it would definitely definetly definetly be one of the first things I'd install.

However.. I have nearly 700 tiddlers..
All with capital letters in their titles and so I am spending increasing amounts of time [[doing this|Doing This]] to link around my wiki.

So my understanding of unilink is that I need to create an alias field.. But in my the alias would be, in all but a handful of cases, the title.. I just need it to be case blind..

Does that mean I have to create each alias field by hand or is there a wonderful filter widget thing and if it can copy the title to the alias would it then become case blind even though the aliases had uppercase letters in them?

Hoping you wonderful peeps can help!

Stephen

PMario

unread,
Mar 5, 2019, 2:31:30 PM3/5/19
to TiddlyWiki
Hi Stephen,

You are right: Alias links are _not_ case-sensitive. So the aliases field can work with [[lower letters]] only if you want. I personally prefer single-word aliases, because they are faster to type. ...

I did think about a possibility, to go for the tiddler title, if I don't find the right aliases. ... I think, the aka-macro would be an easy fix, because we can use the emptyMessage section, that is used for missing aliases at the moment. IMO this wouldn't make any performance difference. 

The problem is backlink handling, which is highly optimized for speed. AND every "missing alias" link that is a real title would show up as "missing alias" at the moment. ...

I'll have a closer look. A very close one ;)

have fun!
mario

PMario

unread,
Mar 5, 2019, 2:35:08 PM3/5/19
to TiddlyWiki
Hi,


-m

Ste Wilson

unread,
Mar 5, 2019, 6:15:14 PM3/5/19
to TiddlyWiki
Hi Mario

Thanks for having a look! :)

TonyM

unread,
Mar 5, 2019, 7:38:07 PM3/5/19
to TiddlyWiki
Ste,

Why are you  [[doing this|Doing This]] . Is it just that you feel titles look better in Caps and not in line in the text. Personally, if I found myself doing something like this manually throughout a document, I would stop and find a better solution. Oddly for me I never need to do this because I choose the title names with caution and do not care if a link contains caps, if the object/tiddler it points to is validly caps.

Please enlighten me and I may have an alternate for you.

Regards
Tony

Diego Mesa

unread,
Mar 5, 2019, 7:40:59 PM3/5/19
to TiddlyWiki
Hey Ste,

A broken answer that hopefully someone else can fix would be:

<$button>
    <$list filter="[tag[HelloThere]]">
        <$action-setfield $field="aliases" $value=<
<currentTiddler>> />
    </$list>
    Add aliases
</$button>

This will cause all tiddler tittles to be copied to a field called aliases HOWEVER, aliases expects tiddler titles with spaces to be contained within double brackets. This does not do that. Hopefully someone else chimes in

Diego

TonyM

unread,
Mar 5, 2019, 8:50:12 PM3/5/19
to TiddlyWiki
Ste,

Let us assume it Is "just that you feel titles look better in lower case in the text". Using CSS will maintain the references or back links.

Create a tiddler tagged $:/tags/Stylesheet
.uc {
  text
-transform: uppercase;
}
.lc { text-transform: lowercase; }
.cc { text-transform: capitalize; }
.nc { text-transform: none; }

Then if and when you want to transform the text use is like this

* [[New Tiddler 42 plus]]
* This method is the best in A sentence @@.nc [[New Tiddler 42 plus]]@@ like this
* @@.nc [[New Tiddler 42 plus]]@@
* @@.lc [[New Tiddler 42 plus]]@@
* @@.uc [[New Tiddler 42 plus]]@@
* @@.cc [[New Tiddler 42 plus]]@@


;.nc [[New Tiddler 42 plus]]
;.lc [[New Tiddler 42 plus]]
;.uc [[New Tiddler 42 plus]]
;.cc [[New Tiddler 42 plus]]


:.nc [[New Tiddler 42 plus]]
:.lc [[New Tiddler 42 plus]]
:.uc [[New Tiddler 42 plus]]
:.cc [[New Tiddler 42 plus]]

You could create an Editor Toolbar button to wrap a tile.

This is best in my view because it is at the place where the link us used you define its format, not globally. 

For items you list use the caption

Regards
Tony

swilson...@gmail.com

unread,
Mar 6, 2019, 4:05:29 AM3/6/19
to tiddl...@googlegroups.com
It was one of those decisions....you know...you start off.  Titles Have Capital Letters Because of Course They Do.....that links in the middle of a sentence, it shouldn't have caps....ok   [[take off the caps|Take Off the Caps]] and here I am 700 later....

PMario

unread,
Mar 6, 2019, 5:21:17 AM3/6/19
to tiddl...@googlegroups.com
Hi,

On Wednesday, March 6, 2019 at 1:38:07 AM UTC+1, TonyM wrote:
...
Why are you  [[doing this|Doing This]] . Is it just that you feel titles look better in Caps and not in line in the text.
...

Uni-link was developed mainly because of this statement:

Alberto Molina wrote at TW group:

For instance, I would like the links: [[Darwinism]], [[darwinism]], NeoDarwinism, NaturalSelection, [[natural selection]], [[theory of evolution]] all refer to the same tiddler (or different twin tiddlers with the same content in view mode) without needing to specify: [[darwinism|Darwinism]], [[NaturalSelection|Darwinism]], [[theory of evolution|Darwinism]], etc.

As you can see there are 2 links [[Darwinism]] and [[darwinism]]. The first one is needed to start a Sentence and the second one as a link in the middle of a sentence. As I developed the plugin, I thought it should be possible to cover both cases with 1 alias. ... That's the reason, why alias-links are _not_ case-sensitive.

An other reason, why I wrote the plugin is, that I think: If you are in edit mode, It should be easy to read the content. IMO [[NaturalSelection|Darwinism]] is not easy to read. Neiter is: ;@@.nc [[New Tiddler 42 plus]]@@

And the best side effect ever is: Alias-links don't break, if you change the tiddler title. ... There is a lot of discussion going on here in the list about UUIDs, which are only usefull for computers. IMO aliases are human friendly and do the same thing.

A full list of all the possibilities can be found at the intro post.

have fun!
mario

swilson...@gmail.com

unread,
Mar 6, 2019, 5:35:11 AM3/6/19
to TiddlyWiki
Cheers for the start!

TonyM

unread,
Mar 6, 2019, 6:13:54 AM3/6/19
to TiddlyWiki
Mario,

Yes Mario I agree aliases may be the best solution here. Unilink as well. The persistent nature with title changes is also fantastic for most use cases. However there are other edge cases for unique ids.

What is the best way do you think to satisfy the original thread. Search and replace the titles and replace with an alias link? If references are currently working he can start with collecting all titles with references then search and replace the [[tiddler name]] with an alias to the tiddler, but perhaps only if he wants them treated the same way.

Regards
Tony

Ste Wilson

unread,
Mar 6, 2019, 7:35:12 AM3/6/19
to TiddlyWiki
For me the title as alias would be perfect. I have a small number where I can add other aliases individually. I guess the actual problem then is the next bit of Diego's widget/ filter thingy to create that field AND put [[]] around everything.
Then I can [[not do this|Not do This]] going forward and remove examples from the text as I come across them....unless threr was a search and replace filter... :)

Ste

PMario

unread,
Mar 6, 2019, 7:49:30 AM3/6/19
to TiddlyWiki
On Wednesday, March 6, 2019 at 1:35:12 PM UTC+1, Ste Wilson wrote:
For me the title as alias would be perfect.

I think, that's the way to go.
 
 I have a small number where I can add other aliases individually.  I guess the actual problem then is the next bit of Diego's widget/ filter thingy to create that field AND put [[]] around everything.
Then I can [[not do this|Not do This]] going forward and remove examples from the text as I come across them....unless threr was a search and replace filter... :)

Ste


I think turning all titles to aliases is not the way to go.

As I wrote backlink handling is the important thing. To detect standard [[links]] and [[alias-links]] is a very "costly" operation. That's why they use a caching mechanism, which guaranties a performant lookup. ... But there is still an iteration process involved, that needs to touch every tiddler.

With the number of list-filter operators going up, it's very convenient for users to create more and more lookups, that iterate through all tiddlers over and over and over again. ...

That's why I think it's important to be careful to implement new functions that have the potential to slow down the app.

just some thoughts.

have fun!
mario

Mark S.

unread,
Mar 6, 2019, 11:30:45 AM3/6/19
to TiddlyWiki


On Wednesday, March 6, 2019 at 4:49:30 AM UTC-8, PMario wrote:

I think turning all titles to aliases is not the way to go.



How about all titles that are currently back-linked (linked to) somewhere? Unless of course, all 700 are linked somewhere, in which case ... never mind.

-- Mark

Ste Wilson

unread,
Mar 6, 2019, 1:35:16 PM3/6/19
to TiddlyWiki
Think most of them link to somewhere or are part of a tag structure.

tiddlyspot.stephenteacher.com

PMario

unread,
Mar 7, 2019, 6:29:06 AM3/7/19
to TiddlyWiki
@Ste ... That's a great source! http://stephenteacher.tiddlyspot.com/
-m

Ste Wilson

unread,
Mar 7, 2019, 7:01:14 PM3/7/19
to TiddlyWiki
I knew there was something wrong with the address as I typed it... :D...

Anthony Muscio

unread,
Mar 7, 2019, 7:24:57 PM3/7/19
to TiddlyWiki
Mario,

Is there a way to make a caching operation available to super users of TiddlyWiki? I have generated a tool to this thousands of post Codes against a businesses service areas, currently they are dumped into a large data tiddler. I do not mind that it needs a manual refresh but wondering if there could be some form of generic caching process we could use?

Regrds
Tony

Anthony Muscio


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/WMWXNrMHbt4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a6c8454d-84d3-4d62-929f-50a0f6846f09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PMario

unread,
Mar 8, 2019, 9:00:09 AM3/8/19
to tiddl...@googlegroups.com
On Friday, March 8, 2019 at 1:24:57 AM UTC+1, TonyM wrote:
...
Is there a way to make a caching operation available to super users of TiddlyWiki?

They are very low level and for a specialized purpose. ... eg: backlink detection requires the function to create a parse-tree for the tiddler. Then it checks if there is a "link to xxx". It takes the xxx and stores it into an array, that's much easier to check. ... So every lookup for xxx just uses that array, which is much faster.

The same is done with alias-backlinks. ... but the detection phase uses a completely different algorithm, while the mechanism is the same.

I have generated a tool to this thousands of post Codes against a businesses service areas, currently they are dumped into a large data tiddler. I do not mind that it needs a manual refresh but wondering if there could be some form of generic caching process we could use?

I think what you want here is a database like index and not a cache as described earlier.

---------------------

With TW we use a lot of naming conventions. eg: $:/core/ui/ViewTemplate/xxx as seen in the TW-Explorer. The different tiddlers are also tagged $:/tags/ViewTemplate. ...

To check if a tiddler is tagged that way, we need to check every tiddler in the system. Both shadow and "real" tiddlers. ... The more tiddlers, the more work to do.

The above example gives us 2 ways to build indices.

 1) use the "prefix" $:/core/ui/ViewTemplate/ and store the "nodes" below it.
 2) create a tag-based index for every tag.

A possible index structure, that I have in mind here is called radix-trie. Since there is only 1 "main rule" in TW. "The title has to be unique" imo this would be a very good fit. ... Sure we still have "shadow" tiddlers and "real -> system + tiddlers". ...

----------------- Back to your post codes. OT

I think this mechanism could also handle them well... How does your "data-set" look like?

----------------- end OT

I was thinking about indexing aliases for quite some time now. ...

have fun!
mario

TonyM

unread,
Mar 9, 2019, 3:12:20 AM3/9/19
to TiddlyWiki
Mario,

The data tiddler contains hundreds or low thousands of 4 digit post codes each with one of say 50 area names. The idea is to search this for the area. However it may not demand enought resources for an index, and only occasional search.

If I now understand perhaps I should generate a tiddler for each post code and tag them with on of the areas?

Currently I generated the data tiddler from 50 areas which list the range of post codes in each area.
Eg "[range[2000,2199]] 2300 [range[2400,2501]] 2512"

Perhaps I should use another method to compute on the fly like the leading diget is one of "7" states then only use variables. Infact using variables may be the faster way to search if the data is compressed as this is in some ways.

A code pattern that uses a variable as the searchable data may be the best way in this case. I can stop when matched.

Regards
Tony

PMario

unread,
Mar 12, 2019, 10:21:15 AM3/12/19
to TiddlyWiki
Hi Ste, and everyone interested,

I did create an experimental version, (which I won't publish atm), that has the following functions.

[[alias|?]] ... default alias link
[[alias|?t]] ... use alias and display title
[[alias|?c]] ... use alias and display caption
[[alias|?s]] ... use alias and display subtitle
[[alias|?myField]] ... use alias and display field: myField

and new:

[[title|?l]] ... lower letter L ... case insensitive title search ... l .. for lazy

I think you can spot the inconsistency. ... The first 5 possibilities work with "aliases" definitions and show fields. This one works with the title. :/

I could use [[title|!]] ... BUT there is not enough visual difference between "the pipe" | and the "exclamation mark" ! eg: |! 

AND the default meaning in a wikitext link is [[pretty link text|title]] ... So the new thing is wrong order.  ... So I don't like it.

An other possibility would be to use [lazy[title]], or [?[title]]

The point is: It can be done and I'm willing to implement it, because I think it makes sense.

The question is: How should the wikitext look like?   <--- Feedback needed

have fun!
mario

PMario

unread,
Mar 12, 2019, 10:26:00 AM3/12/19
to TiddlyWiki
Hi,

There is 1 more problem. Searching for case insensitive titles will produce 2 or more links if titles "overlap" eg: [[This Title]] and [[this Title]] will both match [[this title|?l]] at the moment.

The user will be responsible here!

-m

Diego Mesa

unread,
Mar 12, 2019, 10:48:59 AM3/12/19
to TiddlyWiki
Hey Mario,

In my mind the consistenct of unilink has been:

[[What-I-Want-To-Type|What-I-Want-To-Display]]

I frequently title my tiddlers their "full correct title", but rarely do I want to actually type them out, hence me giving them aliases. In Stephen's first post, he mentioned giving every tiddler an alias of its title, allowing you to use unilink unmodified. I like this conceptual approach better, where unilink could behind the scenes, have an option to treat all tiddlers as if they already have a "Shadow alias" of their title. This also maintains the consistency I mentioned above

Ste Wilson

unread,
Mar 12, 2019, 3:21:40 PM3/12/19
to TiddlyWiki
Mario, your awesome.

PMario

unread,
Mar 12, 2019, 9:15:30 PM3/12/19
to TiddlyWiki
On Tuesday, March 12, 2019 at 3:48:59 PM UTC+1, Diego Mesa wrote:
... In Stephen's first post, he mentioned giving every tiddler an alias of its title, allowing you to use unilink unmodified.

As I understand it, he don't want to give them an alias.

-m

PMario

unread,
Mar 12, 2019, 9:18:30 PM3/12/19
to TiddlyWiki
Hi,

For me an alias has 2 major advantages. ..

 1 Less to type (for the lazy folk ;)
 2 Links don't break, if tiddler gets a new title.

IMO the OP should also be for "the lazy folk" ;)

-m

PMario

unread,
Mar 12, 2019, 9:20:31 PM3/12/19
to TiddlyWiki
On Tuesday, March 12, 2019 at 3:48:59 PM UTC+1, Diego Mesa wrote:
Hey Mario,
In my mind the consistenct of unilink has been:

[[What-I-Want-To-Type|What-I-Want-To-Display]]

Hmmmm, I can see the argument.

-m

PMario

unread,
Mar 12, 2019, 9:22:02 PM3/12/19
to TiddlyWiki
On Tuesday, March 12, 2019 at 8:21:40 PM UTC+1, Ste Wilson wrote:
Mario, your awesome.

:)

But how should the link look like?

-m

Ste Wilson

unread,
Apr 20, 2019, 12:21:03 PM4/20/19
to TiddlyWiki

Hi Mario, been meaning to reply to this for AGES.

[lazy[title]] looks good to me or [[alias|?lz]]?

PMario

unread,
Mar 13, 2021, 11:54:43 AM3/13/21
to TiddlyWiki
Hi Ste,

With the latest discussions going on about "link attributes" I did re-visit the "feature wishlist" and came back to this thread.

What do you think about
 - title: This is a Test
 - link: [[this is a test|??]]

Where the second ? means: "search for the exact title ... case insensitive" .... Which is pretty much exactly what you requested.

On the other hand the "search for title" function in the core has the same possibilities as the search[] operator. ...

-mario

Ste

unread,
Mar 15, 2021, 4:28:30 PM3/15/21
to TiddlyWiki
Hi Mario! 
I'd forgotton about this! 
Yes that sound like it would do the job. 

Thanks! 

PMario

unread,
Mar 17, 2021, 5:56:20 PM3/17/21
to TiddlyWiki
@Ste
https://wikilabs.github.io/editions/uni-link/ V2.1.0 has been released: Have a closer look at "Uni-link Search" function.

[[case insensitive title|??]] ... There are 2 question marks, the second one indicates the "case insensitive search"

have fun!
mario

Ste

unread,
Mar 19, 2021, 6:57:36 AM3/19/21
to TiddlyWiki
Thanks for that Mario.
Just done a quick test, [[velocity|??]] returns Angular Velocity, not Velocity.  It's not a big problem as this will mostly be used with longer titles.  Thanks again!

Reply all
Reply to author
Forward
0 new messages