Automatic Alt Text for linked notes

I’d really like a plugin that automatically added alt text for every note you link to. For example, if you typed [[Some Idea]] and hit enter, it would auto-complete to [[Some Idea|Some Idea]] so that even when you change the file name, the note will still look the same wherever you linked to it.

Naturally, if a note had an alias in the frontmatter and you typed in that alias, I wouldn’t want the plugin to overwrite the alt text of whatever the alias was with the filename. It would be very convenient if this worked with files that didn’t exist yet.

The reason I would find this useful is because I want to link to notes in my other notes that don’t exist yet, but when I create them I typically change the name. However, I don’t want to change their appearance in the file.
For example, lets say I have this note:

Francois Babeuf.md:

# Francois Babeuf
Francois Babeuf lived from xxxx-xxxx, was a Jacobin and invented [[The Robes Strategy]]

And then I create this:
The Robes Strategy.md:

# The 'Robes' Strategy
[[Francois Babeuf]], a French revolutionary and [[Anarchist]], created The Robes Strategy, which taught that if you want the support of the people, you needed support from the robes—people who wore robes professionally like pastors, judges, and professors.

Now, if I change the filename (say, remove the ‘The’), it will change the [[The Robes Strategy]] inside Francois Babeuf.md to [[Robes Strategy]] (which will no longer fit smoothly into the sentence). As such, I always add alt text such as [[The Robes Strategy|The Robes Strategy]] so that the display won’t change when the filename does. Ordinarily, I’d just add a alias equivalent to the note name to to the frontmatter of all my notes, but I can’t do that with notes that haven’t been created yet.

2 Likes

This is a great idea, and would be super useful for me as well.

1 Like