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.

About Graham

I make it faster and easier for you to create high-quality code.
This entry was posted in code-level, software-engineering, tool-support. Bookmark the permalink.

1 Response to Literate Programming with LibreOffice

  1. Tim Daly says:

    https://en.wikipedia.org/wiki/Axiom_(computer_algebra_system) 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

    \begin{chunk}{somename}

    code goes here

    \end{chunk}

    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 http://axiom-developer.org/axiom-website/documentation.html

    On that page is a link to http://axiom-developer.org/axiom-website/litprog.html 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”).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.