Hi everyone,
the Link with alias plugin is available since today for Obsidian community.
It can support you in process of link creation, mainly in cases when you need alias in target note with link display text which differs from Note name. It is a common case for inflectional languages with many word forms.
I developed this plugin, because I needed to create thousands of links during process of conversion of plain text to wikipedia-like notes. So it is already quite well tested
Use cases
Make link on existing text
User selects some text and runs the command “Create link with alias”. The command creates a new link with target and display name copied from selected text and opens the link autocompletion popup and …
A) … user can just select a value from the autocompletion popup, press Enter and link and alias are created.
B) … user can edit the link target then select a value from the autocompletion popup, press Enter and link and alias are created. Note that link text is kept.
C) … user can enter name of new note, let cursor leave the link, then the new note is created automatically with link display text as alias.
Add alias for existing link
User puts cursor into existing link and runs command “Create link with alias”. The command creates the target document, if it doesn’t exist, and adds link display text as alias into front matter of the target note
Make completely new link
User puts cursor into text and runs command “Create link with alias”. It creates link brackets and opens autocompletion popup for entering of link target name. After user types in part of the target name or alias and selects it by enter, the link is created. If there is no display text and user moves back into link and enters one, then system detects it and after cursor leaves the brackets or user closes the window, the link display text is added as alias into front matter of the target note. While this use case is supported, it is usually faster to write text without link first and then Make link on existing text.
Notes
- The alias is added into front matter of the target note only when it isn’t there yet
- The aliases are sorted from longest to shortest, so the Obsidian backlinks are detected correctly
- The link autocompletion popup is the standard one provided by Obsidian. It sometime replaces the link text automaticaly, but it isn’t wanted in this use case. The action “Create link with alias” will keep the link text exactly the same like it was before.
I am looking forward to your feedback
I hope it helps you too!