I want to create a hyperlink to a specific section of another file.
Say I have two files A.md and B.md, and B.md has the sections #1 #2 #3.
Now I know that I can reference, say, #2 in A by [[B#2]].
However I want to make it like a hyperlink and mask it with some other text.
I suppose that what I want can be done somehow like [link](B#2), but this doesn’t work, it just references me to the beginning of the B.md file.
So I just want the result to look like this, but link me to section #2 of file B.md.
Does anyone have an idea of how I can do this?
Hello @Fjolfrin you’ll find the answer on how to do this if you open the help and read the page on internal links.
You are asking two different things. First, how to link to blocks in other notes, and also how to create an alias for a link.
Firstly, to create a link to a block in another file. Typing
[[^^ will bring up a modal you can type in to search for a specific block within other notes. If you want to link to a block within the same note, use a single chevron.
Secondly, after selecting the block you would like to link to, you can use the pipe character
| after the link text but within the same
[] to create an alias for the link.
When creating a link with an alias, it would be formatted as
[[B.md|#2]]; this would show
#2 as the link text inline but navigate to
B.md when clicked. So in your case, you would have the link to the specific block rather than B.md.
Look at Link with aliases in the help guide on this topic for a better understanding.
@jwl, That did it. I didn’t understand that I could set aliases like [[path#to_the_thing|alias]], I only knew [alias](path_to_te_thing), maybe I read the documentation too hastily and I missed it.
Thanks a lot!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.