1

Is there a way to show hover text of internal links in exported HTML in org-mode? Sometime I would like to have a quick peek of the reference details of a org-ref citation link when reading the exported HTMLs of my notes.

3
  • Give the link text text-property help-echo with the text you want to show in a tooltip.
    – Drew
    Oct 29 '20 at 1:33
  • @Drew That works in org-mode buffer, but not in the exported HTML. Oct 29 '20 at 4:53
  • Sorry; I didn't read the question well. Thx.
    – Drew
    Oct 29 '20 at 7:02
1

The best way is to define your own cite export function like this and then set it on the cite link.

(defun my-html-cite-export (keys desc format)
  (mapconcat
    (lambda (key)
      (format "<a class='org-ref-reference' href=\"#%s\" title=\"%s\">%s</a>"
          key
          (org-ref-format-entry key)
          key))
    (org-ref-split-and-strip-string keys) ","))

(org-link-set-parameters "cite" :export #'my-html-cite-export)

This has some limitations, it only applies on cite links, and not the many other types of cite links, and it only supports html export. There isn't another way to do this at this time though.

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.