Freelinking

@bernardo_v

I never said they are the same.

Correct, you did not, and I did not say you did. But the fact that you mention them as a possible alternative to Freelinks led me to make that comment.

What do you mean by this? Double brackets? If so, then that is not the case in DEVONthink nor in VoodooPad.

Yes, I meant double brackets. We’re talking about Obsidian, not about DEVONthink nor about VoodooPad.

Aliases are precisely for this purpose. If you are using aliases, then you will know if you typed the title of a note or any of the aliases of that note.

As far as I know, if you have a note entitled e.g. “The Highest Mountain”, and you have an alias e.g. Mount Everest, then each time you want to link to your note you can write either [[The Highest Mountain]] or [[Mount Everest]].

That is not how Freelinks work. With Freelinks, if you are typing a text and you happen to type The Highest Mountain, Freelinks will colour that as a link, you can even click on it, but in the raw markdown there are no brackets. If you type the highest mountain, as you normally would, FL won’t pick that up.

So, the difference is that with an Alias you have to use square brackets to make the link - and you have to remember which aliases you made - with Freelinks that’s not the case. But with FL you have to rely on a coincidence of typing the right note title.

sounds like what you want is a combination of free links with aliases where it picks up pre established aliases freelink style? So when you type highest mountain it will pick up your Mount Everest note?

@lizardmenfromspace: actually the OP was not from me, I just replied because I know Freelinks from my TiddlyWiki days. If I am not mistaken you use(d) TW too, so you may know the FL plug-in.

I also looked at another TW plug-in, Unilinks or Uni-Alias (can’t remember the exact name), which is similar to what @bernardo_v is talking about. I did not use it because of the need to have to remember what aliases you have set up.

The usefulness of FL is limited. I admit there will be instances where it will pick up a potential connection, but what it also does is pick up false positives.

So, I believe that FL, as far as the OP is concerned, would be more useful, but it would have to be something more sophisticated that what I referred to above.

Could you point out where you think this happened? If you are thinking about the thread to which I linked, in the DT forum, then you have not understood correctly the name nor what is being described.

I am not familiar at all with the behaviour you are describing. Perhaps you could point out which software behaves in this way.

My suggestion would be for an option to turn on automatic wiki links. This means that…

chocolate would appear as a link without the need of adding double brackets. I can just click on it as it is. And precisely the same thing would happen with the aliases of chocolate (cocoa, milk, dark chocolate). Should I happen to type dark chocolate, then voilà, we would have a link.

@bernardo_v

I am not familiar at all with the behaviour you are describing. Perhaps you could point out which software behaves in this way.

The Unilinks or Uni-Alias (can’t remember the exact name) in TiddlyWiki, as I mentioned to @lizardmenfromspace.

My suggestion would be for an option to turn on automatic wiki links. This means that if I have a note called “chocolate” and the in another note type “I like chocolate” then a link would automatically be added to “chocolate” even without me adding [[.

OK, I get it now. That looks interesting indeed. I have 3 points about it:

  1. if you want this to be effective and act as your scout, for each note you create you would also have to create 1 or more aliases for keywords in that note, so that when you write a new note with one of those aliases in, your scout would flag it immediately;
  2. would those unbracketed links be shown in the backlinks? In TiddlyWiki, Freelinks marks words as links without the use of square brackets, and those links, although clickable and therefore usable, do not show up as backlinks. So, to make them completely useful you have to add square brackets amnually, which I find a bit laborious;
  3. aliases should be case-insensitive.
1 Like

Good to know!

Ok, I see. I only experimented with TiddlyWiki. It looks interesting.

Not necessarily. I have plenty of notes with no aliases and other with dozens of them. It all depends on the role of that note in your system. To give a simple example, the note Home that I use as a starting point to navigate doesn’t have any aliases nor does it need any.

That is a very good question. It all depends on the developers, actually. In DEVONthink I do this with an applescript that searches for occurrences of the title (and the aliases) of each note in the other notes. Then it sorts and organizes them, adding the results to the bottom of each note or to a special metadata field.

I think the main problem would be for the graph view. It would have to able to draw connections without the need of double brackets style links AND handle the enormous amount of connections that would pop up (which I am not sure it could do). As it is right now, it can barely display my folder of notes (around three thousand files) with no connections between them (since they rely on auto wiki links). I mean, it displays them, but in slow motion.

That is also how I prefer it.

Ah, but I am thinking about my zettelkasten, and in principle all notes in there are equal: there is no hierarchy and each note should have links to other notes. When I start a new note I want to find other notes I can link to, and depends on the concept the note deals with (I use tags for that), as well as the words used in the text which is where Freelinks/Alias/Whatever comes in. So, for a zettelkasten, I think most notes should have aliases associated with them. That also brings the possibility that an alias one intends to create might already exist, so that should flagged by the system immediately.

I have been hesitating about DevonThink for this kind of application, but I am not sure that is what it can do.

Just to add to this discussion, tomboy notes and it’s newest implementation here, have kind of the same functionality. Basically while you are typing, if it finds a note with the title of the text you just wrote, it will automatically create a link to that note.
This functionality has its pros and cons, but I would love to see this on Obsidian.

1 Like

Yes some might not like it so it could be a preference setting, disabled means business as before. Freelinking was the reason I used VoodooPad since 2005 but the stagnation of that app development put a stop for using it.

3 Likes

I don’t know how long we might be waiting for a plugin to handle freelinking/forward-linking and that feature is critical to me, so I wrote a Python script to interpret forward links in text.

https://github.com/perkinsben/obs_tools/tree/master/forward_linker

What the tool does:

  • Scans your Obsidian vault root folder recursively for .md files and builds a list of note titles
  • Sorts the titles from longest to shortest
  • Pulls the text from your clipboard
  • Searches through that text for instances of the titles
  • Replaces the text with the link (includes handling of differing case)
  • Pushes the linked text back to the clipboard

It’s not brilliant, but it’s not stupid either. It will handle a lot of different scenarios - it won’t chop words in half, it ignores link text inside of other links, etc. It still requires a once-over to verify/clean up, but it does a good job. If you have duplicated titles in your vault (ie. Obsidian prefixed them with a folder name) you’ll only get links to the original (unqualified) page with that title.

Example

Assuming you had the following pages in your Obsidian vault:

  • Psychology.md
  • Science.md
  • Behavior.md

And the following text in your clipboard to import:

Psychology is the Science of human behavior.

After executing the script, it would be replaced with the following:

[[Psychology]] is the [[Science]] of human [[Behavior|behavior]].

I created a shortcut on my desktop to run it. PM me if you see a bug.

5 Likes

Very impressive. How often and/or when does one need to run the script?

Also, how can I download the file from Github?

1 Like

If you jump up a couple of folders, there is an option to clone or download at https://github.com/perkinsben/obs_tools. You can also copy and paste the script into a new file. You’ll need to install Python 3, pip and pyperclip library (‘pip install pyperclip’).

I run the script when I’m adding new content to my vault. Either content I’ve written or collected. It won’t interfere with forward links that are already present in your text, so it’s good to use to verify that there aren’t additional pages that could be linked. The safest place to do the linking would probably be a text editor:

  • Place content to be linked in editor
  • Select all, copy to clipboard
  • Run script
  • Return to text editor, paste from clipboard to overwrite
  • Verify/clean up, then paste into Obsidian
3 Likes

Thanks. The only thing I don’t understand is the penultimate and ultimate steps.

In the penultimate step you paste from clipboard to overwrite what? Surely the old content of the new note.

In the lat step you say “then paste into Obsidian”, but in the previous step the pasting was already in Obsidian, wasn’t it? What am I missing?

Update: I went ahead, installed python3, copied the raw script data into a text file and saved it as obs-linkr.py in the folder with my notes. I created a test note with text containing just 1 word that is also the title of a note. Here is the output from the terminal:

1 Like

In the lat step you say “then paste into Obsidian”, but in the previous step the pasting was already in Obsidian, wasn’t it? What am I missing?

I was using the example of doing the text linking in another text editor, then bringing in to Obsidian, but I probably overcomplicated it. Yes, the whole deal can be done inside Obsidian, since it’s just clipboard manipulation.

PM me with your Python install issues - you’ve got something else going on in your environment based on that output. I don’t want to muddy up the focus of this thread too much.

1 Like

Well done Ben and very helpful for my workflow - always impressing how clear and fast Python code is. With a bit of additional help from Keyboard maestro some select, copy and paste stuff can also be reduced to the max. Thanks!

1 Like

Could also build a locally-stored search index file, which is probably useful throughout the whole program.

1 Like

This feature would be excellent to see in the future as a plugin.

3 Likes

Very exciting if this becomes a plugin - am too scared of the python stuff! very exciting:-)

1 Like

I imagine that this is just a simple o(1) lookup (Set and WeakMap in Javascript for example), and that it should be sufficiently fast to do this in real time even with many 1000’s of files, especially if you limit it to only work with words that has been completed.

the loading of an existing file, or updating existing files would be more of an issue I think. Caching would fix, but that is annoying.