Hello,

I'm using Nikola (https://getnikola.com/) with its orgmode plugin to write blog posts. Their script contains following custom link for HTML export:

    (defun org-custom-link-img-url-export (path desc format)
      (cond
       ((eq format 'html)
        (format "<img src=\"%s\" alt=\"%s\"/>" path desc))))
    (org-add-link-type "img-url" nil 'org-custom-link-img-url-export)


And I have org-mode contents like this:

    #+CAPTION: some caption for the image
    #+ATTR_HTML: width="60%"
    [[img-url:/img/a.jpg]]

I found that somehow DESC parameter passed to above org-custom-link-img-url-export function contains all information regarding CAPTION and ATTR_HTML but unable to retrieve it properly. Is there any org utility functions to retrieve them? For example, I want to access 'width' parameter from ATTR_HTML like this:

    (defun org-custom-link-img-url-export (path desc format)
      (cond
       ((eq format 'html)
        (let ((width (SOME-FUNCTION desc :width)))
          (if (null width)
              (format "<img ... width=\"%s\"/>" ... width)
            (format "<img .../>" ...))))))

Could you help me how to do that?

Thank you.

Reply via email to