emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* accessing ATTR_HTML and CAPTION from custom
@ 2018-03-10  3:53 Seong-Kook Shin
  0 siblings, 0 replies; only message in thread
From: Seong-Kook Shin @ 2018-03-10  3:53 UTC (permalink / raw)
  To: emacs-orgmode

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-10  3:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-10  3:53 accessing ATTR_HTML and CAPTION from custom Seong-Kook Shin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).