Re: Setting language on result of code block

2020-08-02 Thread John Herrlin


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  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::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::the-topic"
> }
> #+end_example
>
> /M



Setting language on result of code block

2020-08-02 Thread Magnus Therning
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::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::the-topic"
}
#+end_example

/M

--
Magnus Therning  OpenPGP: 0x927912051716CE39
email: mag...@therning.org
twitter: magthe  http://magnus.therning.org/

Every act of creation is first an act of destruction.
 — Pablo Picasso


signature.asc
Description: PGP signature