emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: Brett Viren
Subject: [O] Code block returning code results formatted as another type of code block?
Date: Wed, 03 Feb 2016 17:39:36 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

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.

Attachment: signature.asc
Description: PGP signature


reply via email to

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