Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding CUSTOM_ID of a brain (sub+)section node for HTML exports. #397

Open
drawkula opened this issue Mar 27, 2024 · 3 comments
Open

Finding CUSTOM_ID of a brain (sub+)section node for HTML exports. #397

drawkula opened this issue Mar 27, 2024 · 3 comments
Labels

Comments

@drawkula
Copy link

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.

@Kungsgeten
Copy link
Owner

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)))))

@drawkula
Copy link
Author

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.

@Kungsgeten
Copy link
Owner

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")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants