A Literate Programming (LP) "Hello World" Example
Allegra is being written using literate programming
development methods. For those unfamiliar with this technique, or who
have not used Norm Walsh's DocBook/XML-based LitProg LP system with Ada,
we have created a small "Hello, world" example to illustrate the process.
There are three files associated with this example:
- helloworld.xweb - The
initial XML source file from which the other two files were created.
This is the part that I edit to update the program or the
documentation. I created it using XEmacs's PSGML mode and this DTD, which comes with the LitProg package.
It's really just a DocBook XML source document, with a couple of tags
that Walsh's XSLT stylsheets recognize. I use the GNOME project's xsltproc stylesheet processor to do
the tangling and weaving.
- helloworld.adb - The
actual Ada source program created by "tangling" the XML source. It's
totally trivial, and I never edit it directly.
- helloworld.html - The
program document, including the "user guide" and the design/maintenance
documentation, created by "weaving" the XML source. As with the source,
I never edit this file directly. It includes more links to the related
software and concepts.
Chip Richards
Last modified: Sat Dec 6 16:10:43 MST 2003