After reading the org-mode manual I didn't find a way to construct structured links referring to headings with endless depth, like:
having a file.org:
* 1
** 1
** 2
*** 1
<---link here
with the link: [[path/to/file.org::*1:2:1]]
It should work also with link abbreviations:
#+LINK: file path/to/file.org::*%s
[[file:1:2:1]]
I was told that I need to write a custom link type to achieve this. I'm aware of the <<target>>
, CUSTOM_ID and ID options but they are not good for my use case, where I have a fixed, non-changing structure with a lot of short "leaves". E.g. the Bible. It doesn't make sense to mark each verse with a CUSTOM_ID, when you already have all this information in the headings hierarchy. The raw text will become less readable without any advantage in flexibility (those verses are not going to be restructured).
I'm not that experienced in writing in elisp. Is it difficult to create such custom link type? What is the closest link type that you would recommend to take as starting point (link on code, if possible)?
P.S.:
Maybe, for a more general case, it will be a good idea to be able to also add a <<target>>
at the end of the tree, like:
[[MyBook:Chapter 1:Section 5:Subsection 3:target]]
* Chapter 1
...
** Section 5
...
*** Subsection 3
...
<<target>>
...