org: post
14.8.2.25 ‘:post’
.................
The ‘:post’ header argument is used to post-process the results of a
code block execution. When a post argument is given, the results of the
code block will temporarily be bound to the ‘*this*’ variable. This
variable may then be included in header argument forms such as those
used in var header argument specifications allowing passing of
results to other code blocks, or direct execution via Emacs Lisp.
The following example illustrates the usage of the ‘:post’ header
argument.
#+name: attr_wrap
#+begin_src sh :var data="" :var width="\\textwidth" :results output
echo "#+ATTR_LATEX :width $width"
echo "$data"
#+end_src
#+header: :file /tmp/it.png
#+begin_src dot :post attr_wrap(width="5cm", data=*this*) :results drawer
digraph{
a -> b;
b -> c;
c -> a;
}
#+end_src
#+RESULTS:
:RESULTS:
#+ATTR_LATEX :width 5cm
[[file:/tmp/it.png]]
:END: