emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-set-link-parameters get html attributes
@ 2018-08-22 17:57 Tarjei Bærland
  0 siblings, 0 replies; only message in thread
From: Tarjei Bærland @ 2018-08-22 17:57 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

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

only message in thread, other threads:[~2018-08-22 17:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22 17:57 org-set-link-parameters get html attributes Tarjei Bærland

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).