The source code for computer programs is destined to be read by compilers and consequently its internal structure is heavily constrained. The compiler neither knows nor cares about such things as a program's internal structure, the relationships between its components and their specifications, the way design patterns are instantiated, the best way to explain its algorithms or how it is intended to be used. People do. Literate programming (LP) was invented by Donald Knuth as a way to address such problems. The idea is appealing but LP has not been adopted widely: the lack of good tools, difficulties with object-oriented languages and the limitations of a single psychological order are among the reasons. We report the development of theme-based literate programming (TBLP). Themes are extremely flexible: they may be aimed at particular reader groups or represent aspects of the program. Features of TBLP include an extended chunk model which accommodates a richer variety of types, an extended connection model which allows chunks to be threaded together into multiple themes, an enhanced processing model which generalises tangling and weaving and a chunk-level version management system. XML is used to represent the web structure and XML-based technologies such as XSLT are used in processing. This provides flexibility and extensibility, allowing users to define new chunk types. An application which implements TBLP is presented and the integration of TBLP with software engineering processes is discussed.
['Andreas Kacofegitis', 'Neville Churcher']
Theme-based literate programming