Plugin to match pre-existing wiki links to pre-existing aliases of the same name

Request for a plugin to match pre-existing wikilinks to pre-existing aliases of the same name.

Why?

  1. Filenames can’t have colons or question marks or other special characters.

When your filename is X-Men First Class but the film title is actually X-Men: First Class, then all your existing unresolved wikilinks [[X-Men: First Class]] will never lead anywhere because no filename can have a colon so it will never match. (In fact clicking on the link in some circumstances will create another file!) But if your existing file includes an alias with the same name as the wikilink, then why not create a match with the alias rather than the filename?

:question: But why do you have pre-existing unresolved wikilinks?

I imported an article and read it. As I was reading I put brackets around the film titles or director names. I didn’t ‘resolve’ them as I was going because that would interfere with reading. Or, I put in those brackets in another program. Which leads to No 2.

  1. Sometimes you edit outside of Obsidian and can’t remember the exact title of the file.

You might have a file called newsletter idea, but you don’t remember if it is newsletter idea or the plural newsletter ideas. You had the wherewithal to have an alias for the alternate, just in case. So you are in another program typing away and you put brackets around [[newsletter idea]]. Turns out you were wrong: the title was plural. That link will never serve its purpose.

:question: What would the plug-in do?

It would work just like Obsidian works, except it would look to aliases (after looking to filenames?) rather than filenames to resolve the links.

:question: And if you have multiple files with the same alias?

Do nothing. It’s what Obsidian does now.

:question: And if you have multiple aliases for a file?

Resolve to the one that is identical to the wikilink.
If the wikilink is [[X-Men: First Class]] do not resolve to the alias: "X-Men: First Class - the Book" but do resolve to the alias: "X-Men: First Class"

:question: And should the plug-in change the existing wikilink?

Should it change [[X-Men: First Class]] to [[Film/X-Men First Class | X-Men: First Class]]? Not sure. I’d like it to, but others have mentioned not wanting to modify one’s entire database. The one thing that is essential, though, is that the links display in graph.

:question: And if it does change the wikilink, what should it display?

There should be an option for default behavior: show the title or show the alias.
There should also be an option for the term alias or aliases.

For more info, see the (very long) discussion that begins here: Discord and a proposed solution by NothingIsLost here: Discord

6 Likes