Skip to main content
3 of 4
fix typos, improve wording
stsquad
  • 4.7k
  • 31
  • 45

What is the mechanism by which org-export collates links for the summary?

I use org-export to generate my end of week email reports. One of the links I have in those reports is for mu4e searches. I have a helper function to translate them into something more useful:

;; Exporting
(defvar my-org-mu4e-index-links
  (rx
   (: (or "query:i:" "msgid:") (group-n 1 (one-or-more any))))
  "A regex to match mu4e links of the form:

    query:i:[email protected]
")

(defun my-org-mu4e-export (path desc format)
  "Format mu4e links for export."
  (when (string-match my-org-mu4e-index-links path)
    (cond
     ((eq format 'html)
      (format "<a href=\"%s%s\">%s</a>"
              "https://www.google.com/search?q="
              (match-string 1 path)
              desc))
     ((eq format 'jira)
      (format "[%s|%s%s]"
              desc
              "https://www.google.com/search?q="
              (match-string 1 path)))
     ((eq format 'ascii)
      (format "%s\nMessage-Id: <%s>" desc (match-string 1 path))))))

(use-package ox
  :config
  (org-link-set-parameters "mu4e" :export 'my-org-mu4e-export))

However what I really want is what happens with other links where the link text is surrounded by [] and the link is displayed at the bottom of the section. e.g.:

Task 1
======

  - posted message [about foo] to mailing list

[foo] Message-Id: <bar>

However I've not been able to work out where in the exporter transcoders and filters this is done. I assume I should be able to set some sort of parameter for mu4e style links to deal do this.

stsquad
  • 4.7k
  • 31
  • 45