Next: , Previous: , Up: Specific header arguments   [Contents][Index] :noweb-ref

When expanding “noweb” style references the bodies of all code block with either a block name matching the reference name or a :noweb-ref header argument matching the reference name will be concatenated together to form the replacement text.

By setting this header argument at the sub-tree or file level, simple code block concatenation may be achieved. For example, when tangling the following Org mode file, the bodies of code blocks will be concatenated into the resulting pure code file172.

 #+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
   df \

 ** strip the header row
   |sed '1d' \

 ** sort by the percent full
   |awk '{print $5 " " $6}'|sort -n |tail -1 \

 ** extract the mount point
   |awk '{print $2}'

The :noweb-sep (see noweb-sep) header argument holds the string used to separate accumulate noweb references like those above. By default a newline is used.



(The example needs property inheritance to be turned on for the noweb-ref property, see Property inheritance).