[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Handling custom link types for html export in v 9.0 - Replacemen

From: John Kitchin
Subject: Re: [O] Handling custom link types for html export in v 9.0 - Replacement for deprecated `org-add-link-type`?
Date: Tue, 18 Apr 2017 10:00:05 -0400
User-agent: mu4e 0.9.19; emacs 25.1.1

You can find a many examples of the new link syntax here:

You will probably be able to reuse much of your old code  and this:

   :follow (your-old-follow-code)
   :export (your-old-export-code))

Milan Zimmermann writes:

> Hi:
> I have a question about how to define custom link type, which before
> 9.0 used the (9.0) deprecated  `org-add-link-type`.
> 1. Let me first provide the context:
> There is often a need to generate, for org links export/publish to
> Html, elements where img src URL starts with a slash, like this
> <img src="/images/a.jpg" >
> The only way that was possible before v9, for this to be exported from
> a link such as
> [[/images/a.jgp]]
> was to use a method described in
> http://stackoverflow.com/questions/14684263/how-to-org-mode-image-absolute-path-of-export-html
> - Basically, the solution described there is
> a) define a custom link type such as "img"
> b) in org,  use [[img:images/a.jpg]]
> c) define two functions handling the img link in org and on
> export/publish, and call (org-add-link-type "img"
> 'org-custom-link-img-follow 'org-custom-link-img-export)
> 2. The problem and question
> In org 9.0, we get `org-add-link-type ... This function is obsolete
> since Org 9.0 use `org-link-set-parameters' instead.
> My problem is I have no idea how to, in a practical sense, use
> `org-link-set-parameters` to define a custom link type "img" and
> handle it's image handling in both org buffer and Html publish.
> My question is, are there any links and examples how one would do the
> above in 9.0?
> Thanks
> Milan

Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213

reply via email to

[Prev in Thread] Current Thread [Next in Thread]