Hi good night. This is what I am trying to achieve: I use the dagger character † as a reference or a substitute to footnotes. Let say I get thee following info from the obsidian wiki:
“Use aliases for things like acronyms, nicknames, or to refer to a note in a different language.” I will place the dagger right next to the end of the sentence. The dagger will be just the alias of the actual link to the source material (web page), that way I reduce clutter in my notes. Like this †
The solution that I am lookin for is someway to automatically add the dagger as an alias when pasting the link. It would be activated with a special hotkey. It will probably require me to use templater, but I don’t know the script that I should use.
At the moment, I need to first paste the link, and then manually add the alias.
And no. I know I could use footnote for my use case, but using footnotes and then having to extract a portion of your note when it becomes too big, while containing a lot of footnotes is one of the most tedious thing one could do. For some reason someone decided to implement the “Extract this heading…” tool without also extracting footnotes. When having 50+ footnotes, you can imagine how much time you lose just trying to check which footnotes have to be extracted and which ones don’t.
Two ideas spring to mind. First if you use Web clipper to copy the text initially I believe you could get its template to insert everything as you want it from the start.
Secondly, if you instead of pasting the link and then call the template, I’d rather place my cursor correctly and then call the template, let it generate the link from await tp.system.clipboard() with the dagger as the display, and then insert that link.
After you’ve set up a folder within Settings > Templater for your template, create a file in there called something nice, like myExample.md, and put the following into it:
<%*
let link = (await tp.system.clipboard()).trim()
console.log(">" + link + "<")
if (link == "" ) {
link = await tp.system.prompt("Which link do you want to use?")
}
tR += `[†](${ link.trim() })`
_%>
Now you could add a hotkey for the template by going to Settings > Templater > Template hotkeys, and click on the Add new hotkey for template. Select the empty line, and enter the name of your template. After this hit the plus icon after the name, and you’ll be sent to the hotkeys section of the settings.
Here you select the Templater: Insert .../<your name> by hitting the plus icon after that line, and then press a key combination of your choice.
Now you can exit the settings, and if you’ve got a link in the clipboard, just place the cursor after the quote, and hit your key combination, and it should be inserted. If you’ve got just empty text in the clipboard, it’s going to ask you for a link. Note it doesn’t check whether the text is actually a link or not.