Literate

A Flexible Literate Programming System

View the literate source code for Literate!

View the literate source code for this website!

See the Github page.

What is Literate Programming?

Literate programming is a style of programming invented by Donald Knuth, where the main idea is that a program's source code is made primarily to be read and understood by other people, and secondarily to be executed by the computer.

This frees the programmer from the structure of a program imposed by the computer and means that the programmer can develop programs in the order of the flow of their thoughts.

A Literate program consists of explanation of the code in a natural language such as English, interspersed with snippets of code to be executed. This means that Literate programs are very easy to understand and share, as all the code is well explained.

Literate, a tool for literate programming, will allow you to take a literate source file (*.lit) and either tangle the source file which will create a file with executable code, or weave the source file, which will generate an HTML document to be read as formatted documentation.

Features of this tool

Literate works with any programming language, generates HTML as output (which can be converted to pdf), and generates readable code. The code that is generated is indented properly and is automatically commented using the titles you have written for the code blocks.

Here is the full list of features:
You can get started by taking a look at the manual. In addition, this website is made with Literate, and the source can be read here.