Re: [O] Code block returning code results formatted as another type of code block?

2016-02-04 Thread Brett Viren
"Charles C. Berry"  writes:

> Try `:wrap src json':

Works perfectly, thanks.  I had missed this in the manual, but it was
there for me all along!

  http://orgmode.org/manual/wrap.html

-Brett.


signature.asc
Description: PGP signature


Re: [O] Code block returning code results formatted as another type of code block?

2016-02-03 Thread Charles C. Berry

On Wed, 3 Feb 2016, Brett Viren wrote:


Hi,

I have some shell command line program that spits out JSON.  I want Org
execute that command from a source block (of type "sh") and have the
result displayed as another source block of type "json".



Try `:wrap src json':

#+BEGIN_SRC sh  :exports both :results value code :wrap src json
echo '{"foo":"bar", "baz":"quax"}'
#+END_SRC

#+RESULTS:
#+BEGIN_src json
{"foo":"bar", "baz":"quax"}
#+END_src


HTH,

Chuck



[O] Code block returning code results formatted as another type of code block?

2016-02-03 Thread Brett Viren
Hi,

I have some shell command line program that spits out JSON.  I want Org
execute that command from a source block (of type "sh") and have the
result displayed as another source block of type "json".  I can almost
get all that working except the resulting block is also of type "sh":

I have:


#+BEGIN_SRC sh  :exports both :format json :results value code 
echo '{"foo":"bar", "baz":"quax"}'
#+END_SRC

#+RESULTS:
#+BEGIN_SRC sh
{"foo":"bar", "baz":"quax"}
#+END_SRC


But, instead, I want the result:


#+RESULTS:
#+BEGIN_SRC json
{"foo":"bar", "baz":"quax"}
#+END_SRC


Is there some arg to the initial source block which I'm missing?

I guessed with that ":format json" arg.  With or without it makes no
difference.


Thanks!
-Brett.


signature.asc
Description: PGP signature