Markdown variable substitution

Some markdown systems support templating engines, where you can define a variable and have its value substituted in whenever you reference it; this could be helpful for taking concise notes.

My particular use case (I’m sure there are others): I take notes on youtube videos, and want to cite each point by linking back to the location in the video, e.g. Obsidian is cool [00:30](youtube.com/exampleurl?t=00m30s). This can get very unwieldy, with many long links that are almost identical except for the timestamp at the end.
What if I could define somewhere in the file that ${yturl} = youtube.com/exampleurl?t=, and then write Obsidian is cool [00:30](${yturl}00m30s), which the markdown interpreter would expand back into the full link? Much more concise and simple to write, while having an equally readable source and the same rendered output.

2 Likes

Some existing implementations:

Some options for defining value of variable:

This sounds like what you are looking for: GitHub - d-brown43/obsidian-macros

1 Like