From: John Herrlin <jherrlin@gmail.com>
To: Magnus Therning <magnus@therning.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Setting language on result of code block
Date: Sun, 02 Aug 2020 22:54:57 +0200 [thread overview]
Message-ID: <874kpklqe7.fsf@gmail.com> (raw)
In-Reply-To: <87ft94hj1w.fsf@therning.org>
You can use =:wrap= for that.
Here is the docs: https://orgmode.org/manual/Results-of-Evaluation.html
And here is an example.
#+BEGIN_SRC shell :results output :wrap example json
curl http://ip.jsontest.com/
#+END_SRC
#+RESULTS:
#+begin_example json
{"ip": "8.8.8.8"}
#+end_example
Best regards
John
Magnus Therning <magnus@therning.org> writes:
> Is there some way to specify the language on the result of a code block.
> For instance, if the block
>
> #+begin_src bash
> aws --endpoint-url=http://localhost:4566 sns create-topic --name the-topic
> #+end_src
>
> gives the result
>
> #+RESULTS:
> #+begin_example
> {
> "TopicArn": "arn:aws:sns:eu-central-1:000000000000:the-topic"
> }
> #+end_example
>
> Is there some way I can specify that the result is JSON? That is get the
> result
>
> #+RESULTS:
> #+begin_example json
> {
> "TopicArn": "arn:aws:sns:eu-central-1:000000000000:the-topic"
> }
> #+end_example
>
> /M
prev parent reply other threads:[~2020-08-02 20:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-02 20:47 Setting language on result of code block Magnus Therning
2020-08-02 20:54 ` John Herrlin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874kpklqe7.fsf@gmail.com \
--to=jherrlin@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=magnus@therning.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).