emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] non-standard link errors


From: Skip Collins
Subject: Re: [O] non-standard link errors
Date: Sun, 28 Feb 2016 23:04:24 -0500

Nicolas Goaziou <address@hidden> wrote:
> Not that I'm against the idea, but wouldn't it be a poor way to properly
> fix the issue, i.e., add new link types?

I have come up with a better solution than globally passing "broken"
links. I defined a new "raw" link type. So now if I want to put a
non-standard link in my export, I can do something like:
Here is a [[raw:foo:/\bar, baz][bad link]].
which is exported in html as:
Here is a <a href="foo:/\bar, baz">bad link</a>.

Now I can have non-standard links included in the output without
disabling link checking for all standard link types. This is how it is
defined in my .emacs:
(org-add-link-type "raw" 'org-raw-follow 'org-raw-export)
(defun org-raw-follow (path))
(defun org-raw-export (path desc format)
  "Export a raw link.
See `org-add-link-type' for details about PATH, DESC and FORMAT."
  (cond
   ((eq format 'html) (format "<a href=\"%s\">%s</a>" path desc))
   ((eq format 'latex) (format "\\href{%s}{%s}" path desc))
   ((eq format 'ascii) (format "%s (%s)" desc path))
   (t path)))

Perhaps this could be included in the standard Org distribution as a
fallback option for exporting non-standard link types. Emacs/Org does
nothing with the link. The user is responsible for ensuring the output
is correct.



reply via email to

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