Open drawkula opened 5 months ago
So you want the custom ID of a headline entry? How do you want to get it, like choosing from a list and pasting/yanking it into the buffer? If so maybe something like this:
(defun org-brain-yank-id ()
(interactive)
(insert (car (last (org-brain-choose-entry "Get ID of entry: "
(org-brain-headline-entries) nil t)))))
For being able to generate ™human friendly™ references in HTML exports, I need to find the CUSTOM_ID for a known ID. If all else fails, I can scan for it via AWK, but there probably is a better way.
If you know the ID you could use something like this (not related to org-brain, only using the builtin org functions):
(org-entry-properties (org-find-id "the ID of the entry") "CUSTOM_ID")
I'm (ab?)using org-brain to keep track of my notes which typically shall be glued together as bigger HTML exports.
Finding links to single file brain nodes is easy, but I'd like to find the file/CUSTOM_ID value for (sub+)section references.
So far I've only done trivial stuff in Elisp and would't even know where to search.