From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Put result output in different type of code block than original Date: Tue, 11 Oct 2011 08:32:58 -0600 Message-ID: <877h4bmwdh.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:58028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDdOJ-0005cE-Bu for emacs-orgmode@gnu.org; Tue, 11 Oct 2011 10:33:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDdOC-0007wr-Qo for emacs-orgmode@gnu.org; Tue, 11 Oct 2011 10:33:11 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:46609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDdOC-0007wh-OO for emacs-orgmode@gnu.org; Tue, 11 Oct 2011 10:33:04 -0400 Received: by vws16 with SMTP id 16so6906849vws.0 for ; Tue, 11 Oct 2011 07:33:04 -0700 (PDT) In-Reply-To: (Niels Giesen's message of "Mon, 10 Oct 2011 17:44:57 +0200") 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 Niels Giesen writes: > 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? > Hi Niels, Currently there is no way to specify the type of returned source code block. Hopefully one of Rainer or Rasmus' suggestions to this thread should serve as a sufficient work around. I would augment Rainer's solution changing it to the following... #+begin_src sh :results scalar raw echo "#+begin_src json" curl https://our-service.org/getstuff?username=dirk\&password=catsbrithday\&fmt=json echo "#+end_src json" #+end_src which works for me -- or presumably would work for me if our-service could getstfff for dirk with password catsbirthday. Cheers -- Eric > > #+begin_src sh :results output code :exports both > curl > https://our-service.org/getstuff?username=dirk\&password=catsbrithday\&fmt=json > #+end_src > > #+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? -- Eric Schulte http://cs.unm.edu/~eschulte/