I'm wondering if there is a way to add hyperlinks to noweb references, i.e., in the following org-mode snippet:
#+name: list-all
#+begin_src sh
ls -a
#+end_src
and we come here
#+begin_src sh :noweb no-export :tangle myscript.sh
echo "Hello world"
<<list-all>>
#+end_src
When exporting to html or latex,
I would like to have the <<list-all>> to be a link to the code block
being referenced by it.
I have noticed that this is the case in some noweb implementations
other than org-modes' one. I've checked the documentation and I don't
seem to find anything about this.
This would be an invaluable feature to have.
I'm not able to put the links within the src block (for that you probably need to add a filter to
org-export-filter-src-block-functions: the filter, however, needs to work with the exported format).However, I am happy with this solution I implemented after having read this reddit post.
Example
Let's say you have this org file:
Then I can export it to html with this elisp code:
Resulting in this: