From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Tarjei_B=C3=A6rland?= Subject: org-set-link-parameters get html attributes Date: Wed, 22 Aug 2018 19:57:33 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e6ded6057409e056" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsXO6-0004kw-4h for emacs-orgmode@gnu.org; Wed, 22 Aug 2018 13:57:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsXO3-0004Li-Vp for emacs-orgmode@gnu.org; Wed, 22 Aug 2018 13:57:46 -0400 Received: from mail-yb0-x22c.google.com ([2607:f8b0:4002:c09::22c]:34715) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fsXO2-0004LG-D3 for emacs-orgmode@gnu.org; Wed, 22 Aug 2018 13:57:43 -0400 Received: by mail-yb0-x22c.google.com with SMTP id t10-v6so1007476ybb.1 for ; Wed, 22 Aug 2018 10:57:41 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --000000000000e6ded6057409e056 Content-Type: text/plain; charset="UTF-8" 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 "\"%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

Alt text

How can I get my new link format to include html attributes? All help much appreciated! Regards, Tarjei --000000000000e6ded6057409e056 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello!

I have created a custom link format in org mode, [= [fig:path][desc]], defined as

(org-link-set-parameters
=C2=A0 =C2= =A0"fig"
=C2=A0 =C2=A0:follow (lambda (path)
(org-open-f= ile-with-emacs
=C2=A0(format "../figurer/%s" path)))
=C2= =A0 =C2=A0:export (lambda (path desc backend)
(cond
=C2=A0((eq = backend 'html)
=C2=A0 (format (concat "<img src=3D\"= figurer/%s\""
=C2=A0 " alt=3D\"%s\"/>&q= uot;)
=C2=A0 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 i= mage 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=3D"150px">
<img src=3D"fig= urer/figname.png" alt=3D"Alt text"/>
</p>
How can I get my new link format to include html attributes? All help much= appreciated!

Regards,

Tarjei
--000000000000e6ded6057409e056--