emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Understand the source of "Unable to resolve link"


From: Kaushal Modi
Subject: Re: [O] Understand the source of "Unable to resolve link"
Date: Sun, 04 Feb 2018 20:42:05 +0000

On Sun, Feb 4, 2018 at 11:31 AM Nicolas Goaziou <address@hidden> wrote:
Note that you cannot simply copy "http" or "https" types. As default
type links, they are hard-coded in every export back-end. It means they
do not have to set any :export property.

As a user, if you want to export a "gopher" link type, you need to
implement a function exporting it, and register it as the :export value.

Thank you.

This works.

(defun org-link-gopher-export-link (link desc format)
  "Create export version of LINK and DESC to FORMAT."
  (let ((link (concat "gopher:" link)))
    (cond
     ((eq format 'html)
      (format "<a href="" link desc))
     ((eq format 'latex)
      (format "\\href{%s}{%s}" link desc))
     (t                               ;`ascii', `md', `hugo', etc.
      (format "[%s](%s)" desc link)))))
(org-link-set-parameters "gopher" :export #'org-link-gopher-export-link)
--

Kaushal Modi


reply via email to

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