- Before
#+begin_src sh :results scalar replace echo "Hello World" #+end_src #+RESULTS: : Hello World
echo "Hello World"
- After
#+begin_src sh :results scalar replace :wrap my_wrapper echo "Hello World" #+end_src #+RESULTS: #+BEGIN_my_wrapper Hello World #+END_my_wrapper
echo "Hello World"
- Answer: Yes
#+begin_src sh :wrap WORD1 WORD2 echo "Does ~:wrap~ header allow spaces?" #+end_src #+RESULTS: #+BEGIN_WORD1 WORD2 Does ~:wrap~ header allow spaces? #+END_WORD1
echo "Does ~:wrap~ header allow spaces?"
- Answer: Yes but must call dynamic values using elisp.
#+NAME: a_named_comment #+BEGIN_COMMENT VALUE_FROM_NAMED_COMMENT #+END_COMMENT #+CALL: a_named_comment() #+RESULTS: : VALUE_FROM_NAMED_COMMENT #+begin_src sh :wrap (org-sbe a_named_comment) echo "Does ~:wrap~ header allow dynamic values?" #+end_src #+RESULTS: #+BEGIN_VALUE_FROM_NAMED_COMMENT Does ~:wrap~ header allow dynamic values? #+END_VALUE_FROM_NAMED_COMMENT
echo "Does ~:wrap~ header allow dynamic values?"
- Troubleshooting: What happens if don’t use elisp
(org-sbe )
syntax, e.g. a_named_comment()Answer: Same results as passing a string value.
# Try 1 #+begin_src sh :wrap a_named_comment() echo "Does ~:wrap~ header allow dynamic values?" #+end_src #+RESULTS: #+BEGIN_a_named_comment() Does ~:wrap~ header allow dynamic values? #+END_a_named_comment() # Try 2 #+begin_src sh :wrap call_a_named_comment() echo "Does ~:wrap~ header allow dynamic values?" #+end_src #+RESULTS: #+BEGIN_call_a_named_comment() Does ~:wrap~ header allow dynamic values? #+END_call_a_named_comment()
echo "Does ~:wrap~ header allow dynamic values?"
echo "Does ~:wrap~ header allow dynamic values?"
- Troubleshooting: What happens if don’t use elisp