From: "Tarjei Bærland" <tarjeibaerland@gmail.com>
To: emacs-orgmode@gnu.org
Subject: org-set-link-parameters get html attributes
Date: Wed, 22 Aug 2018 19:57:33 +0200 [thread overview]
Message-ID: <CAJ+-Syxi3_NUf2+z+umYwcaVdzxC_ui9Hnhn+7ZgJAf5AxH5iA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 849 bytes --]
Hello!
I have created a custom link format in org mode, [[fig:path][desc]],
defined as
(org-link-set-parameters
"fig"
:follow (lambda (path)
(org-open-file-with-emacs
(format "../figurer/%s" path)))
:export (lambda (path desc backend)
(cond
((eq backend 'html)
(format (concat "<img src=\"figurer/%s\""
" alt=\"%s\"/>")
path (or desc path))))))
I need this to be able to have one copy of the images, while having .org
and exported .html files in different directory levels.
However, if I now want to export an image with html attributes and caption,
e.g.
#+CAPTION:A caption
#+HTML_ATTR: :width 150px
[[fig:figname.png][Alt text]]
This ends up as
<p width="150px">
<img src="figurer/figname.png" alt="Alt text"/>
</p>
How can I get my new link format to include html attributes? All help much
appreciated!
Regards,
Tarjei
[-- Attachment #2: Type: text/html, Size: 1199 bytes --]
reply other threads:[~2018-08-22 17:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJ+-Syxi3_NUf2+z+umYwcaVdzxC_ui9Hnhn+7ZgJAf5AxH5iA@mail.gmail.com \
--to=tarjeibaerland@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).