** code block export template
   :PROPERTIES:
   :DATE:     2012-01-14
   :END:

The =org-babel-exp-code-template= (see below for its documentation)
variable may be customized to control which information from code
blocks is exported.

- Example code block
  #+Name: foo
  #+BEGIN_SRC sh :bar baz
    echo qux
  #+END_SRC

- Evaluate this block to export (shows the export of the name).
  #+Name: do-export-name
  #+BEGIN_SRC emacs-lisp :results silent
    (let ((org-babel-exp-code-template
           "\n=%name=:\n#+BEGIN_SRC %lang%flags\n%body\n#+END_SRC"))
      (org-export-as-html nil))
  #+END_SRC

- Evaluate this block to export (shows the export of header arguments).
  #+Name: do-export-header-arguments
  #+BEGIN_SRC emacs-lisp :results silent
    (let ((org-babel-exp-code-template
           "Header arguments for =%name=.
    | header  | value    |
    |---------+----------|
    | bar     | %bar     |
    | results | %results |\n#+BEGIN_SRC %lang%flags\n%body\n#+END_SRC"))
      (org-export-as-html nil))
  #+END_SRC

: ,----[org-babel-exp-code-template]
: | org-babel-exp-code-template is a variable defined in `ob-exp.el'.
: | Its value is "#+BEGIN_SRC %lang%flags\n%body\n#+END_SRC"
: | 
: | Documentation:
: | Template used to export the body of code blocks.
: | This template may be customized to include additional information
: | such as the code block name, or the values of particular header
: | arguments.  The template is filled out using `org-fill-template',
: | and the following %keys may be used.
: | 
: |  lang ------ the language of the code block
: |  name ------ the name of the code block
: |  body ------ the body of the code block
: |  flags ----- the flags passed to the code block
: | 
: | In addition to the keys mentioned above, every header argument
: | defined for the code block may be used as a key and will be
: | replaced with its value.
: | 
: | You can customize this variable.
: `----