2020-12-03 23:04:56 +00:00
|
|
|
#+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:
|
|
|
|
|
2024-09-30 21:11:21 +00:00
|
|
|
#+NAME: first-code-name
|
2020-12-05 23:26:44 +00:00
|
|
|
#+BEGIN_SRC shell :results verbatim
|
2020-12-03 23:04:56 +00:00
|
|
|
echo "This is a test"
|
2020-12-05 23:26:44 +00:00
|
|
|
echo "with two lines"
|
2020-12-03 23:04:56 +00:00
|
|
|
exit 0 # Exit successfully
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
: This is a test
|
2020-12-05 23:26:44 +00:00
|
|
|
: with two lines
|
2020-12-03 23:04:56 +00:00
|
|
|
|
|
|
|
* Second item
|
|
|
|
:PROPERTIES:
|
|
|
|
:ID: 04-code-second-item-id
|
|
|
|
:CREATED: [2020-01-01 Wed 01:01]
|
|
|
|
:END:
|
|
|
|
|
|
|
|
#+BEGIN_SRC shell :results drawer
|
2020-12-05 23:26:44 +00:00
|
|
|
echo "This is another test"
|
|
|
|
echo "with two lines too"
|
|
|
|
exit 0 # Comment
|
2020-12-03 23:04:56 +00:00
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
:results:
|
|
|
|
This is another test
|
2020-12-05 23:26:44 +00:00
|
|
|
with two lines too
|
2020-12-03 23:04:56 +00:00
|
|
|
:end:
|
2022-11-16 23:20:20 +00:00
|
|
|
|
|
|
|
* 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
|