Tangling an org-mode file when the :tangle
parameter is set to yes
, writes each block into a single file based on a language and the name of the org file. In this case, my file is /tmp/example.org
, so all Ruby blocks will be written into a single file, /tmp/example.rb
. But this can be change as shown below.
For this example, the :tangle
parameter is simply yes
, which grabs the defaults:
echo In section one
Since this block is Ruby, it will be written to a different file.
print("In section one")
Let’s do some python, which will be different since we change its tangling location:
puts 'In section one'
The blocks in this section are written to multiple files by explicitly specifying the :tangle
parameter:
echo In section two
Another script, tangled into a different file:
echo In section two ... yet again.
For these blocks, the tangled filename has been overridden by a subtree’s property setting:
echo In section three
This block will be combined with the previous one:
echo Still in section three
Did this work?
ls /tmp/example* /tmp/section*