Literate Programming Using Org Babel

Gregory Stein has an excellent post on Literate Programming with Org-Mode. Despite the title, it’s really more about leveraging Org Babel to create literate documents that contain notes, code, and results. This is, of course, the same area that Howard Abrams covered so well with his Literate DevOps post and video and Stein mentions Abrams work but also adds some material that I wasn’t familiar with.

In his section on working with code blocks, Stein covers how to set parameters that are specific to a language. That’s not useful for individual code blocks, of course, but it’s handy for file-global settings in, say, the :PROPERTIES: drawer when the file contains code from more than one language. He also shows how to enable the asynchronous execution of the code blocks using the ob-async package.

Finally, Stein offers an extended example of setting up a Python virtual buffer, If you program in Python with Emacs, that alone makes his post worthwhile.

Stein’s examples are a little less complex than Abrams’ so his post is a nice introduction to the subject and should probably be read first if you haven’t already read Abrams’ post and watched his video. This is really useful material that’s sure to give you plenty of good ideas; I recommend reading both Stein’s and Abrams’ posts and, of course, watching the video.

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