[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Conditional link export?
From: |
John Kitchin |
Subject: |
Re: [O] Conditional link export? |
Date: |
Sun, 22 Nov 2015 18:08:50 -0500 |
User-agent: |
mu4e 0.9.13; emacs 25.0.50.1 |
That gets closer! Thanks.
It ends up having a duplicate link if you evaluate the inline src in the
org buffer, which outputs an org-link, and then evaluate it again during
the export. The :results raw keeps putting new output inline.
I think I lean more towards modifying the export behavior of a link to
accomplish this goal. It ends up having the same effect as far as I can
tell, with shorter syntax in the org document.
Nicolas Goaziou writes:
> Hello,
>
>> I gave this a try. The idea is to have a function that exports
>> differently in different backends in inline src. I don't need this, but
>> I thought it would be interesting to try as it would enable one thing to
>> transform to many different representations that doesn't go through the
>> new link approach, filter mechanism or the derived backend mechanism.
>>
>> #+BEGIN_SRC emacs-lisp
>> (setq org-export-babel-evaluate 'inline-only)
>>
>> (defun foo (arg1 arg2)
>> (cond
>> ((eq 'html org-export-current-backend)
>> (format "<a href=\"http://some.place/%s\">%s</a>" arg1 arg2))
>> (t
>> (format "[[%s:%s][%s]]" arg1 arg2 arg2))))
>> #+END_SRC
>>
>> src_emacs-lisp[:results raw]{(foo "info" "org")} [[info:org][org]]
>>
>> exports like this:
>>
>> <p>
>> <a href="<a
>> href="http://some.place/info">http://some.place/info</a>">org</a>
>> <a href="org">org</a>
>> </p>
>>
>> It looks like the angle brackets get escaped. I am not sure if there is
>> a way to avoid that without a filter or additional function. Otherwise,
>> it would work I think. Any thoughts?
>
> ":results raw" means results are inserted as raw Org text. This is the
> same as writing text in an Org document before exporting it. As
> a consequence, these results are escaped during the export process.
>
> You could wrap the results in an export snippet, e.g.,
>
> (format "@@html:<a href=\"http://some.place/%s\">%s</a>@@" arg1 arg2)
>
>
> Regards,
--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu
- Re: [O] Conditional link export?, (continued)
- Re: [O] Conditional link export?, Aaron Ecay, 2015/11/06
- Re: [O] Conditional link export?, Oleh Krehel, 2015/11/07
- Re: [O] Conditional link export?, Aaron Ecay, 2015/11/07
- Re: [O] Conditional link export?, Achim Gratz, 2015/11/07
- Re: [O] Conditional link export?, Oleh Krehel, 2015/11/08
- Re: [O] Conditional link export?, Nicolas Goaziou, 2015/11/08
- Re: [O] Conditional link export?, Oleh Krehel, 2015/11/08
- Re: [O] Conditional link export?, Nicolas Goaziou, 2015/11/08
- Re: [O] Conditional link export?, Oleh Krehel, 2015/11/08
- Re: [O] Conditional link export?, Nicolas Goaziou, 2015/11/08
- Message not available
- Message not available
- Message not available
- Message not available
- Re: [O] Conditional link export?,
John Kitchin <=
- Re: [O] Conditional link export?, Aaron Ecay, 2015/11/08
Re: [O] Conditional link export?, John Kitchin, 2015/11/06