emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] evaluation of perl in babel


From: dmg
Subject: Re: [O] evaluation of perl in babel
Date: Mon, 25 Feb 2013 01:57:22 -0800

On Mon, Feb 25, 2013 at 1:54 AM, D M German <address@hidden> wrote:
>
>  Achim> You may misunderstand some things, or I don't understand what you are
>  Achim> asking.  It is (at least currently) the responsibility of the Perl
>  Achim> program (or any other Babel language) to deliver the result in such a
>  Achim> way that it can be interpreted correctly by the result type chosen (in
>  Achim> other word, the program output must be valid Org syntax in the given
>  Achim> context).  You can't have the same program produce tables, vectors and
>  Achim> LaTeX output just by switching the results type.
>
> I understand. But what I want is the output to be wrapped accordingly,
> and my script to deliver exactly the output as expected. So say I want
> to generate HTML in my script, I can use :results output, but then I
> have to change to replace the #+being_example with #+begin_HTML.
>
> I guess that I can generate a two dimensional table with perl too
> using output (printing the necessary | and \n), but then it will be
> wrapped with #+begin_example.

Ok, I got it. What I need is to return a string with whatever I need.
A bit cumbersome, but I can live with it


#+begin_src perl :results html
"<table>
<b>a </b>
</table>
"
#+end_src

#+RESULTS:
#+BEGIN_HTML
<table>
<b>a </b>
</table>
#+END_HTML

thanks again for the explanation,

-- 
--dmg

---
Daniel M. German
http://turingmachine.org



reply via email to

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