org-rw/tests/04-code.org
Sergio Martínez Portela 9b319a90dc
All checks were successful
Testing / pytest (push) Successful in 28s
Testing / mypy (push) Successful in 40s
Testing / style-formatting (push) Successful in 31s
Testing / style-sorted-imports (push) Successful in 24s
Testing / stability-extra-test (push) Successful in 28s
Read names for code blocks.
2024-09-30 23:12:36 +02:00

53 lines
961 B
Org Mode

#+TITLE: 04-Code
#+DESCRIPTION: Simple org file
#+TODO: TODO(t) PAUSED(p) | DONE(d)
* First Item
:PROPERTIES:
:ID: 04-code-first-item-id
:CREATED: [2020-01-01 Wed 01:01]
:END:
#+NAME: first-code-name
#+BEGIN_SRC shell :results verbatim
echo "This is a test"
echo "with two lines"
exit 0 # Exit successfully
#+END_SRC
#+RESULTS:
: This is a test
: with two lines
* Second item
:PROPERTIES:
:ID: 04-code-second-item-id
:CREATED: [2020-01-01 Wed 01:01]
:END:
#+BEGIN_SRC shell :results drawer
echo "This is another test"
echo "with two lines too"
exit 0 # Comment
#+END_SRC
#+RESULTS:
:results:
This is another test
with two lines too
:end:
* Escaped code
:PROPERTIES:
:ID: 04-code-escaped-code-id
:CREATED: [2020-01-01 Wed 01:01]
:END:
#+BEGIN_SRC c :results drawer
/* This code has to be escaped to
,* avoid confusion with new headlines.
,*/
main(){}
#+END_SRC