- publishing free software manuals
The Org Mode 7 Reference Manual
by Carsten Dominik and others
Paperback (6"x9"), 282 pages
ISBN 9781906966089
RRP £9.95 ($14.95)

Sales of this book support the Org project! Get a printed copy>>>

14.4 Extracting source code

Creating pure source code files by extracting code from source blocks is referred to as “tangling”---a term adopted from the literate programming community. During “tangling” of code blocks their bodies are expanded using org-babel-expand-src-block which can expand both variable and “noweb” style references (see section 14.10 Noweb reference syntax).

Header arguments

:tangle no
The default. The code block is not included in the tangled output.
:tangle yes
Include the code block in the tangled output. The output file name is the name of the org file with the extension ‘.org’ replaced by the extension for the block language.
:tangle filename
Include the code block in the tangled output to file ‘filename’.

Functions

org-babel-tangle
Tangle the current file. Bound to C-c C-v t.
org-babel-tangle-file
Choose a file to tangle. Bound to C-c C-v f.

Hooks

org-babel-post-tangle-hook
This hook is run from within code files tangled by org-babel-tangle. Example applications could include post-processing, compilation or evaluation of tangled code files.
ISBN 9781906966089The Org Mode 7 Reference ManualSee the print edition