Skip to content

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.

{ 1 } Comments

  1. Tim Daly | May 22, 2017 at 2:22 pm | Permalink 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”).

Post a Comment

Your email is never published nor shared. Required fields are marked * Comments are moderated; please make sure that your post is civil and valuable before submitting it to improve the chance it will be accepted.