WordPress is all about user customization. It provides the groundwork for managing your content, and the rest of the creativity is up to you. Not only is WordPress expressive with regard to style but also in how you choose to develop and manage your customization. In this article, you’ll learn about how to apply literate programming concepts to WordPress.
The steps taken in this article are compatible with optimized WordPress Hosting accounts.
What is Literate Programming?
Literate programming is an alternative way to write computer programs.
Traditional programs consist of a file, or series of files, that contain the source code of the program interspersed with optional comments about what the discrete bits of code are doing.
Literate programming flips the traditional scheme. A literate program is a written document interspersed with bits of code.
However, since literate programming is not the standard mode of programming, there are few applications out there that support it. One of the most common and widely available applications to provide support for literate programming is the emacs text editor.
Literate Programming and WordPress
WordPress provides an ideal use case for literate programming via its theme and plugin architecture.
You can completely customize your WordPress site without ever touching the massive source code. With custom themes and plugins, you can write small, discrete programs that “hook” and “filter” the behaviors and functions provided by the core.
Literate programming provides a uniquely cohesive way for you to manage the code for your themes and plugins by placing all of your code in a single file.
How To Install The Freerun Base Theme
Follow these steps to install and “tangle” the sample theme. (The file itself contains instructions as well.)
- Download the theme from GitHub
- Create a new directory in the
/wp-content/themes/directory for your theme files
- Place the README.ORG file in the new theme directory
- Open the README file in Emacs
- Enter the key command
Ctrl-C Ctrl-V t
Emacs will “tangle” the necessary files (create them in the directory) so that your theme will be available in WordPress.
That is one example of how you can introduce literate programming fundamentals into your WordPress development workflow. If you have any comments or questions feel free to drop them below.