From: Skip Collins <skip.collins@gmail.com>
To: emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: non-standard link errors
Date: Sun, 28 Feb 2016 23:04:24 -0500 [thread overview]
Message-ID: <CABUh-748yUj7zHxhR+cscfY3T9ri+Uz15mzcnCDoff0BuKPYug@mail.gmail.com> (raw)
In-Reply-To: <874mctck6y.fsf@nicolasgoaziou.fr>
Nicolas Goaziou <mail@nicolasgoaziou.fr> 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.
next prev parent reply other threads:[~2016-02-29 4:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 18:25 non-standard link errors Skip Collins
2016-02-26 21:56 ` Nicolas Goaziou
2016-02-27 18:23 ` Skip Collins
2016-02-28 8:28 ` Nicolas Goaziou
2016-02-29 4:04 ` Skip Collins [this message]
2016-02-29 18:10 ` Nicolas Goaziou
2016-03-02 9:11 ` Simon Thum
2016-03-02 9:28 ` Nicolas Goaziou
2016-03-02 10:46 ` Simon Thum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABUh-748yUj7zHxhR+cscfY3T9ri+Uz15mzcnCDoff0BuKPYug@mail.gmail.com \
--to=skip.collins@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).