This is the official manual for the latest Org-mode release.

Table of Contents

Next: , Previous: noweb, Up: Specific header arguments :noweb-ref

When expanding “noweb” style references, Org concatenates ‘src’ code blocks by matching the reference name to either the block name or the :noweb-ref header argument.

For simple concatenation, set this :noweb-ref header argument at the sub-tree or file level. In the example Org file shown next, the body of the source code in each block is extracted for concatenation to a pure code file1.

      #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh
      * the mount point of the fullest disk
        :noweb-ref: fullest-disk
      ** query all mounted disks
      #+BEGIN_SRC sh
        df \
      ** strip the header row
      #+BEGIN_SRC sh
        |sed '1d' \
      ** sort by the percent full
      #+BEGIN_SRC sh
        |awk '{print $5 " " $6}'|sort -n |tail -1 \
      ** extract the mount point
      #+BEGIN_SRC sh
        |awk '{print $2}'


[1] (For the example to work, turn on the property inheritance for noweb-ref, see Property inheritance).