[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] accessing ATTR_HTML and CAPTION from custom
From: |
Seong-Kook Shin |
Subject: |
[O] accessing ATTR_HTML and CAPTION from custom |
Date: |
Fri, 9 Mar 2018 19:53:49 -0800 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [O] accessing ATTR_HTML and CAPTION from custom,
Seong-Kook Shin <=