0

I am viewing a file which consists of a table of contents followed by the content. Each ToC entry appears to be an internal link of the form [[#fixes][Fixes]].

My understanding is that these internal are defined to point to a heading with a corresponding CUSTOM_ID property. The thing is there are no such properties in the file. In this case the heading pointed to contains:

*** Fixes
- Fix error: (void-variable helm-bookmark-map) when selecting a candidate from
  a Helm buffer (thanks to bmag)
- Fix window number assignation for Neotree buffer window (thanks to duianto)

I.e. no properties. I don't understand how these internal links work. The only way I can mimic this behaviour is by either:

  1. Creating a CUSTOM_ID property under my target heading and linking to that, or
  2. Creating a * as opposed to # link and specifying the heading name.

How do these internal links work when there are no (as far as I can see) custom ids?

For reference, the file I am looking at is the spacemacs CHANGELOG.org file.

4
  • If you click on the link, does it work? And I don't mean on GitHub: if you download CHANGELOG.org locally and click on the link, does it work?
    – NickD
    Jun 15 at 2:00
  • It does. Downloaded, and opened locally. Jun 15 at 8:34
  • That is ... surprising :-)
    – NickD
    Jun 15 at 12:44
  • I added a link to the CHANGELOG.org file to make it easier for people to check if they want.
    – NickD
    Jun 15 at 17:20
0

If you download the CHANGELOG.org file, open it in emacs and then click in the Fixes link, you are going to get an error message:

org-link-search: No match for custom ID: fixes

So you are absolutely right to be perplexed: you need to have a PROPERTY drawer with a CUSTOM_ID property in order for the link to work.

So why does it work on GitHub (for some value of "work")? My (incomplete) understanding is that Org mode files on GitHub are processed using org-ruby to produce HTML, which then gets a mountain of CSS and JS added to it in order to produce the page you see on GitHub. In other words, they take a non-standard implementation and add a lot of their own special sauce to do what they want: you could theoretically do the same thing (assuming they make their CSS and JS available in a readable form), using org-ruby for processing and adding the same CSS and JS, but, editorializing a bit, I would say: No, thanks.

9
  • But here's the thing - I have downloaded the file, am viewing it in emacs and the links work! Jun 15 at 8:12
  • Not for me - they don't. What version of Org mode are you running?
    – NickD
    Jun 15 at 12:43
  • Gnu Emacs version 27.2 Jun 15 at 13:05
  • Do M-x org-version to find out the version of Org mode.
    – NickD
    Jun 15 at 16:13
  • Oops, sorry. Org mode version 9.5 Jun 15 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.