Writing SPIN Documentation

21 May 1997

Overview

Providing clients with informative, well-written documentation is instrumental in expanding the popularity of SPIN. If cavemen cannot figure out how to write applications for SPIN, they will write applications for something else. They may even write entire operating systems for the Exokernel.

Structure

Sections of code are very different. Some are huge and critical to the entire system (e.g. Strands or Dispatcher), while others are small and provide only one service (e.g. External References). Accordingly, documentation will be very different. There is no concrete standard on how documentation should be formatted. This template is a rough guideline on what kind of information should appear in your documentation. The closer we adhere to this standard, the easier it will be to read.

The SPIN documentation tree is part of the source tree. This allows easy referencing of source code and other documentation without absolute path names (hence, the whole tree can be moved without updating links!). Please avoid URLs with absolute pathnames (e.g. use ../../src/Foo.i3 rather than file:/afs/cs/project/..../src/Foo.i3) whenever possible! Documentation is typically contained in a doc directory underneath or next to the src directory for the code being documented.

Tricks

Pathnames

There has been some interest in providing tools which simplify typing long relative pathnames. Several possibilities have been shot down for varying reasons. These include:

Pretty Printing

SRC has a few tools which beautify Modula-3 code. At this time, the simplest to use is m3totex, which combined with latex2html can produce html code. (More info to come on using these. In the meantime, this sample .i3 file illustrates the Modula-3 coding style which m3totex assumes.) In my humble opinion, these tools are more trouble than they are worth. The Dispatcher documentation is a good example of incorporating code into documentation without any fancy tools.

Exporting Documentation

Occasionally it may be nice to extract documentation from the SPIN source tree and create a free-standing documentation tree. A tool to extract documentation is the Perl script /spin/bin/docexport.pl. docexport.pl copies all HTML files in doc directories from a SPIN source tree to a new directory. docexport.pl will also copy any source files linked to from these HTML files, as well as pictures in /projects/spin/www/pics and papers in /projects/spin/www/papers. The idea is to create a hierarchy of HTML files and supplementary files that is as self-contained as possible.

docexport.pl has several command-line options to control the documentation export:

docexport.pl has some limitations and features in parsing HTML:


ddion@cs.washington.edu