Maybe you are looking for inline evaluation of code blocks? Name your code block with #+name: ww
and then use and I'm like call_foo()
. Like this:
* huh
#+NAME: ww
#+BEGIN_SRC shell
echo "wut ever"
#+END_SRC
#+NAME: ww
#+RESULTS:
: wut ever
* testmessage
and I'm like call_ww()
#+END_SRC
You can execute the inline code block by pressing C-c C-c
on it and it will have its result appended after the call in the buffer:
... and I'm like call_foo() {{{results(=wut evah=)}}}
That's a verbatim
wut evah
: you can customize the format a bit using the variable org-babel-inline-result-wrap
'. The built-in Org macro results
just returns its argument unchanged, but you can also redefine that if you want to do something different: Org mode's middle name is flexibility :-). But note that the doc cautions against that:
Moreover, inline source blocks (see *note Structure of Code Blocks::)
use the special ‘results’ macro to mark their output. As such, you are
advised against re-defining it, unless you know what you are doing.
In any case, exporting the document (I would tag the huh
section as :noexport:
so it does not appear in the exported output) produces what you want, I think.