From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Put result output in different type of code block than original Date: Tue, 11 Oct 2011 11:06:47 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e6551d5c2af6a104af023a57 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDYIZ-0005vZ-SI for emacs-orgmode@gnu.org; Tue, 11 Oct 2011 05:06:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDYIT-000382-PF for emacs-orgmode@gnu.org; Tue, 11 Oct 2011 05:06:55 -0400 Received: from mail-qy0-f176.google.com ([209.85.216.176]:58554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDYIT-00037x-LC for emacs-orgmode@gnu.org; Tue, 11 Oct 2011 05:06:49 -0400 Received: by qyk27 with SMTP id 27so6523540qyk.0 for ; Tue, 11 Oct 2011 02:06:49 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Niels Giesen Cc: emacs-orgmode list --0016e6551d5c2af6a104af023a57 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 10, 2011 at 5:44 PM, Niels Giesen wrote: > Hi, > > Say I've got a sh code block invoking curl to some json api, is it possible > some way to specify that the format of the output when :results output code > is in a json code block and *not* a sh code block? > > #+begin_src sh :results output code :exports both > curl > https://our-service.org/getstuff?username=dirk\&password=catsbrithday\&fmt=json > #+end_src > > Does #+begin_src sh :results output :exports both echo #+BEGIN_SRC json curl https://our-service.org/getstuff?username=dirk\&password=catsbrithday\&fmt=json echo #+END_SRC #+end_src help? Rainer > #+results: > #+BEGIN_SRC sh > {"userinfo" : {"id" : "QNCNFQUKKBCTTMAOIUFNOQVLDUFAJV", "fullname" : "Gekke > Dirk", "role" : "user"}} > #+END_SRC > > whereas I'd like it to be > > #+results: > #+BEGIN_SRC json > {"userinfo" : {"id" : "QNCNFQUKKBCTTMAOIUFNOQVLDUFAJV", "fullname" : "Gekke > Dirk", "role" : "user"}} > #+END_SRC > > Any thoughts on how to go about this? Do other people have this same issue > and should there come an option in babel that handles this (one language > outputting source code for another?), or is there a way to specify ones own > outputter? > > -- > http://pft.github.com > -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax (F): +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug --0016e6551d5c2af6a104af023a57 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Mon, Oct 10, 2011 at 5:44 PM, Niels G= iesen <niels= .giesen@gmail.com> wrote:
Hi,

Say I've got a sh code block invoking curl to so= me json api, is it possible some way to specify that the format of the outp= ut when :results output code is in a json code block and *not* a sh code bl= ock?

#+begin_src sh :results output code :exports both<= /div>
#+end_src


Does

=
#+begin_src sh :results output :exports both
echo #+BEGIN_SRC json<= /div>
echo #+END_SRC
#+end_src

help?

Rainer
=A0
#+results:
#+BEGIN_SRC sh
{"userin= fo" : {"id" : "QNCNFQUKKBCTTMAOIUFNOQVLDUFAJV", &q= uot;fullname" : "Gekke Dirk", "role" : "user&= quot;}}
#+END_SRC

whereas I'd like it to be= =A0

#+results:
#+BEGIN_SRC json
{"userinfo" : {"id" : "QNCNFQUKKBCTTMAOIUFNOQVLDUF= AJV", "fullname" : "Gekke Dirk", "role" = : "user"}}
#+END_SRC

Any thoughts on how to go about this? Do other people have this same issue = and should there come an option in babel that handles this (one language ou= tputting source code for another?), or is there a way to specify ones own o= utputter?

--=A0
http://pft.github.com



--
Rainer M. Krug, PhD (Co= nservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Ger= many)

Centre of Excellence for Invasion Biology
Stellenbosch Univ= ersity
South Africa

Tel : =A0 =A0 =A0 +33 - (0)9 53 10 27 44
Cell: =A0 = =A0 =A0 +33 - (0)6 85 62 59 98
Fax (F): =A0 =A0 =A0 +33 - (0)9 58 10 27 = 44

Fax (D): =A0 =A0+49 - (0)3 21 21 25 22 44

email: =A0 =A0 = =A0Rainer@krugs.de=

Skype: =A0 =A0 =A0RMkrug

--0016e6551d5c2af6a104af023a57--