Could Freelinks also capture missing tiddlers? and aliases?

I’m currently reeducating myself to formally become a teacher. A full “educational programme” is a perfect use case for the Freelinks plugin! (Strangely, no link to it on tw.‍com but you find it in the plugin library and in gh.) As you know, Freelinks detects all strings that match existing tiddler titles and so shows the strings as links! With multiple university courses centering around a common subject there are many cross-references where Freelinks really is a blessing.

But, Freelinks misses an opportunity - lemme explain:

First question
To be able to take notes fast, I wrap concepts or names etc in brackets to possibly make them into future tiddlers. This creates links to missing tiddlers.

However, if I’ve bracketed, say, the name [[Piaget]] then I’ve clearly indicated that I consider that string special - so I (of course) want all occurences of Piaget to be “Freelinkified” - even if that tiddler has not been created! (It may be created in a year! This linking is important per se but especially so if I’m using a custom missing tiddler template that actually does things with missing tiddlers, such as lists all occurences of where the title is mentioned! Very useful!)

Second question
Note taking during lectures can be messy. It is often not simple to ensure that a link was typed properly ( - was it spaced vs hyphenated vs camelcased, plural/singular, etc). And in academia, a book or article is typically not even referred to by its title at all but instead by the authors name.

But this is where mklaubers Aliases plugin comes to save the day. For example, a book may have a tiddler like so:

title: On the Origin of Species
aliases: Darwin darwin [[Origins of Species]] [[The Origin of Species]]

Now in the notes I can type…

“According to [[Darwin]] the…”

…and the plugin makes [[Darwin]] link to the book (or, if multiple tiddlers use this same alias, then I’m navigated to the tiddler Darwin (missing or not!) that provides the titles of the tiddlers using this as an alias)

…however, with the Freelinks concept, it shouldn’t even be necessary to wrap the alias in brackets for it to be a link! I.e instead of noting down Darwin and adding brackets to it (which requires the realization during note taking that Darwin should be a link!), one should be able to simply type Darwin and it should automatically be linkified! This would significantly simplify for the note-taker to detect connections!


Summary
Can Freelinks somehow be made to not only match against actual tiddler titles but also:

  1. all missing tiddler titles
  2. all titles in aliases fields

The ideal is perhaps if there is a customizable Freelinks filter to control what a tiddler title should recognize as links to itself. This would significantly enhance Freelinks, making it super useful.



@s793016 and @pmario - I was surprised to see you doing some updating to Freelinks just yestersday! I assumed it has been pretty dormant for a long time as there is little talk about it. I think this concept is totally under-exploited, partially due to limitations indicated here above.

2 Likes

Yes its in the Get New plugins core, but not even mentioned. Other core plugins do have editions for them but this is a gap, and perhaps there is more in the core plugins.

  • Someone could write a plugin to at least extract a title and description of all core plugins, after all there are 68 of them now.

Freelinks as a tool

I have found that in large content wikis, Freelink is an overhead you may want to avoid. Howerver it is still valuable in a research mode to discover, even if you disable it for publishing.

I Agree we should be able to set the filter including missing tiddler/backlinks etc…

I have seen the ability to select in the view template and create a tiddler (even missing) but modifying the underlying text to have a link [[selected words or phrase]]. But it would be helpful to also permit a named tiddler resulting in [[selected words or phrase|tiddler]]

Not withstanding that I did recently make a macro, I intend to include an editor toolbar button for, that allows the author to name a link and provide a tooltip inline, in a field, in a tiddler, in a datatiddler.

  • It the same as using `[[word or phrase]]" but allowing you to create this as a permanent object in different ways with a couple of clicks.
  • So If Freelinks could change an identified word or phrase and save it as my macro even better eg; <<# "word or phrase">> then from that you could at anytime, create a permanent record however you want, to store the text/content describing that word or phrase.
  • This macro format can be found throughout the tiddlywiki with its simple delimiters <<#>> like back links, with a little work.
  • It would be even possible to extend the links operator to similar to my macro.

Note;
One algorithmic trick is if you select some text as follows; “electronic typesetting” within the following;

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

and you want to change it to [[electronic typesetting]] you can search for a broader set eg
but also the leap into electronic typesetting, remaining essentially unchanged. and replacing it with
but also the leap into [[electronic typesetting]] , remaining essentially unchanged.

  • You could even reference/replace the whole text field for 100% on target.

I do not really know, why I am listed as co-author at the GH PR. I only did test it from time to time in early development and did review the code.

Freelinks is not promoted, because it was a performance killer. Even with smaller wikis like our docs at tw-com the UI responsiveness slowdown could be felt with older computers. Especially with mobile devices.

The new search algorithm, that should be available with TW v5.4.0 should be significantly faster. It was tested with a wiki with 11000 tiddlers and the refresh has gone from 1s - 5s down to 100ms - 500ms according to s793016 (the author of the PR)

I did not test the latest version yet. The new algorithm should also be capable to use unicode character sets efficiently. Especially Chinese, which was the main target language for the PR.

So it would be nice if you could post your feedback at GitHub or here.

@TW_Tones

Thanks for your reply even though it goes beyond the OP.

One algorithmic trick is if you select some text as follows; “electronic typesetting” within the following

OK, I interpret that to be a tactic to ensure that only a particular instance of a string is modified. Yes, good idea, thanks.

Back to your questions. I think most of it is possible with the new settings.

  • Word Boundary Check
  • Ignore Case
  • and the Target Filter

In my example I did only use 1 word “Piaget” as target filter.

The “ignore case” setting allows you to “catch” uppercase, lowercase changes.
If the “word boundary” check is disabled, you can catch plural / singular differences.

IMO With the target filter you can catch the rest of your usecases. I personally would create a startup-action, that searches for all missing links and all titles in the aliases-fields and add them to the target filter as a title-list.

So a hypothetical target filter could look like [all[tiddlers]] +[subfilter{my-title-list}] (filter is not tested)

The filter can also be fully dynamic. But depending on the number of missing tiddlers and aliases, a titlelist created at startup may be slightly faster.

Man, and it was even merged already, what luck for me! I’ll try it out but my wiki is not big yet so I doubt I’ll notice anything. Thanks for informing me!

ehm… as usual gh makes me feel like an idiot; How do I actually download that plugin from gh? Googling it says “…right-click the Raw button in the upper right-hand corner and select Save link as…” but there is no “Raw” button on that gh page - ? (And the plugin is not installed in the TW prerelease, and there is no separate edition.)

Help would be appreciated.

Go to https://tiddlywiki.com/prerelease/ and use the plugin library to install the plugin, and then drag it to your wiki or export it.

1 Like

Aha, that worked! (including the need to download the full wiki as the plugin requires a reload when installed)
Thank you!

1 Like

You can drag and drop it or export it without saving/reloading the wiki.

1 Like

This is all very exciting! Freelinks enables wonderful things but there is an issue (which arguably is out of scope for Freelinks). I’ll first review the good stuff:

Thanks to a Freelinks custom filter like so:

[all[tiddlers]] [all[missing]] [all[tiddlers]get[aliases]enlist-input[]]

…I can type [[somelink]] and then wherever somelink (without brackets) appears, it is freelinked, even if a [[somelink]] tiddler is missing. This means that keywords like concepts are linkified after having merely been “identified” (i.e bracketed) once.
Wonderful!

And likewise with any strings mentioned in alias fields. If a tiddler Foo has alias: bar then bar is linkified.

Now, bar doesn’t link/navigate to Foo. To remedy this, a viewtemplate can be used;

<%if [all[shadows+tiddlers]contains:aliases{!!title}] %>
This tiddlers title is an //alias// for:
<$list filter="""[all[shadows+tiddlers]contains:aliases{!!title}]""">

</$list>
<%endif%>

So clicking bar navigates to the (possibly missing) bar tiddler that serves links to whichever tiddlers have bar as an alias.
Great!

…however…

If Foo is the only tiddler that uses bar as an alias, then it would be much better if clicking bar directly navigated to the Foo tiddler! The Aliases plugin does this. And it seems the Freelinks plugin overpowers this Aliases feature when both plugins are installed.

If I understand the Freelinks filter right, it outputs what strings that should be linkified, not what should be “linked to”. But I wonder if a filter could somehow construct prettylinks like [[alias|the-only-tid-with-the-alias]] ?

Any spontaneous thoughts, anyone?

add: Interestingly, I reinstalled the Aliases plugin and this now controls what happens when I click on the alias with only a single targeted tiddler, i.e it navigates directly to it (as desired!).

The reason for reinstalling it was that I noted how the shadow tids in the plugins contents tab were all in italics. I’m not even sure what that would indicate; The tiddlers in a plugin must either be shadow tiddlers or they are overwritten (hence not in italics) - there is no “missing tiddlers” in a plugin (…right?)

I was recently experimenting to get back links, after indentifying tiddlers the mention was in, to search the text for the links and also return the pretty link name.

  • I used a regular expression in the search of each text field

so far it returns a list of titles of the form pretty|tidder, which is similar to your alias|tiddler.

yes they are shadow tiddlers, as long as a title is present

Summary of the current setup, for whoever is interested:

Freelinks (currently pre-release version)
In the settings, the three checkboxes are checked and I use this filter:

[all[tiddlers]] [all[missing]] [all[tiddlers]get[aliases]enlist-input[]]

This linkifies strings that match

  • existing tiddlers
  • missing tiddlers (i.e a string that has once been bracketed somewhere)
  • aliases, i.e strings [[perhaps like]] this in [[aliases fields]]

I’ve also emptied the ...freelinks/styles tiddler which only added extra styling to freelinked strings which I don’t want.

Aliases
I’ve removed all content from the ...aliases/footer shadow because I’m instead using a custom viewtemplate (for all tiddlers, and that lists tiddlers that use the current title as an alias but also backlinks and tagged and other things depending on the current tiddlers tags, like “source”, “concept”, etc).

AFAICT, the only contribution from the Aliases plugin is to make freelinks that only have one associated alias tiddler navigate directly to that tiddler (instead of to a missing tiddler titled like the freelink).

Pretty darn cool stuff!

Now if I could only focus on the paper I’m supposed to write instead!

2 Likes