Org Source Blocks

One of the great things about Emacs is Org-mode. One of the great things about Org-mode is source blocks. They enable literate programming, of course, but are also a great way of taking notes with code examples and a really great way for writing dynamic documents that stay consistent when some item changes.

John Herrlin has a post that serves as a nice introduction to using source blocks. I hadn’t seen awk used in a code block before and was pleased to learn about the :stdin and :in-file parameters as way to direct input to awk. And although it’s obvious in retrospect, he also shows how you can put data in an EXAMPLE block and use it as input to a code block.

Even if you know a bit about Org source blocks, it’s definitely worthwhile taking a look at Herrlin’s post. If you’re trying to come to speed with source blocks, I’d read Herrlin’s post, followed by Abrams’ Literate Devops post, and then watch Mike Hamrick’s video on consistent technical documents. They cover different aspects of source blocks and together serve as a splendid overview on ways to use them.

This entry was posted in General and tagged , . Bookmark the permalink.