Structure and Interpretation of Computer Programmers

I make it easier and faster for you to write high-quality software.

Sunday, May 21, 2017

Literate Programming with LibreOffice

This post comes in the form of an OpenDocumentFormat document containing a program that can extract programs from ODF documents, including the program contained in this document.

posted by Graham at 18:11  

1 Comment »

  1. contains links to the literate programs that make up the Axiom computer algebra system. They were produced using LaTeX.

    Latex is trivially easy to use. Writing an initial document requires almost no markup. Anything special you might want to do can be found online.

    The Axiom documentation uses a trivial markup, called a ‘chunk’ which has a name. as in


    code goes here


    and a program that expects the name of the file (e.g. mydocument.tex) and a chunk name, as in

    tangle mydocument.tex somename

    and writes the result to standard output. You can redirect the output to a file. That’s all the tooling you need. Send me an email and I’ll send you the code to extract chunks. It’s pretty trivial.

    See the page

    On that page is a link to which is an example program to write literate programs in HTML. Like your example, this page contains the code to extract itself from the HTML source.

    The gold standard for literate programming is a book called “Physically Based Rendering” which won an Academy Award. If all programs were written that way it would be easy to maintain and modify them. Buy the book (I have no connection to it) and strive to achieve that level of explanation (not “documentation”, not “comments”).

    Comment by Tim Daly — 2017-05-22 @ 14:22

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress