Documentation

Documentation
SchemeStation documentation

1 Purpose

The purpose of this document is to describe how technical documents are written in the SCHEMESTATION project.

2 Creating documentation

2.1 Writing

2.2 Processing

The script builddocs is used to create actual HTML files from the .ssdoc files with the syntax above.

Run builddocs in a directory that contains all the .ssdoc files. The resulting HTML files will be created in the same directory along with some GIFs when necessary (resulting from rendering math in LaTeX and incorporating XFig figures).

builddocs keeps track of the files it has created (or removed) in a data file named builddocs-data in the current directory. If you remove it accidentally nothing extremely bad happens, but it is nevertheless not recommendable.

builddocs supports the following command line flags:

--clean
Cause builddocs to remove all files it knows it has generated and then exit succesfully.
--export SPEC-FILE
Cause builddocs to export a certain subset of documents according to the specification found from the file SPEC-FILE; see below.
--force
Cause builddocs to remake all external figures without further consideration.
--install DIRECTORY
Cause builddocs to install all files it has generated (i.e. all documentation in HTML form) to the user-supplied directory DIRECTORY, after first generating the files.
--nopics
Do not create any external pictures but write [FIGURE/MATH OMITTED] on the appropriate places. Speeds up things. Does not mix well with --force.
--only BASENAME
Build only BASENAME.ssdoc. Indices etc. are not recreated. Suitable for previewing a document under work.

2.2.1 Categories

Due to the exponential growth the amount of stuff that has been produced it will be more convenient for the possible reader to organize the documents. The strategy outlined here is one proposed solution for the problem.

From now on, the documents will be divided in categories. There can be unlimited amount of categories, but the hierarchy can be only one level deep (that is, in the current implementation.) The category in which the document falls in is defined with the title-tag.

For every category, a new subdirectory will be made. The produced html-files will be put into that very directory, along with a index file that possesses a link to every document in that category. A global index file will be produced in the parent directory of these subdirectories.

It should be easy to copy or move these directories to wherever the httpd expects, which may (provided that the categorization is very smart) make the export strategy obsolete.

.builddocsrc
The categories are specified in the .builddocsrc-file. While this is strictly speaking redundant - the categories could be created dynamically as they occur in the title-tags - it may provide some protection against typos, since categories differing by, say, a single letter will not be created.

The syntax for the file is as follows:

course:subdir=course,title=Course related documents
First comes the name of the category which should be the same that will be specified in the title-tag. Next are the attribute-value pair separated by a colon. The recognized attributes are subdir (the directory where the html-documents are put) and title (title to appear in the per category index file).

2.2.2 Exporting subsets of documentation

builddocs allows you to export a subset of your documents to a specified directory. To accomplish this, you need to write an export specification file that tells the script what documents to export and how.

The file is parsed on line-by-line basis. Every line is one of the following:

2.2.2.1 File specifications

File specification is of form

file BASENAME
and specifies that the document BASENAME (whose source is in BASENAME.ssdoc) should be exported.

2.2.2.2 Target specification

Target specification is of form

target DIRECTORY
and specifies that the installation should take place to the directory DIRECTORY. It is mandatory to specify a target.

2.2.2.3 Regions

Regions are used to specify arbitrary text that will be inserted into the index page of the document distribution. Region start is of form

region NAME
where NAME should be one of the following: head, title, tail and beforeindex.

Region end is of form

end-region

All text between a region start and a region end or another region start is region text. The index page is built then as follows:

[head]
[title]
... documents listing ...
[beforeindex]
... index ...
[tail]
where [NAME] refers to the region text of the region named NAME.

If index is not generated, then the region text ``beforeindex'' is not inserted. Index is not generated by default. You can toggle whether or not index will be generated, see below.

2.2.2.4 Commands

A command is a simple optional one-word command. Currently the following commands are recognized:

makeindex
Generate index (the default is do not generate)
omitstatus
Don't show the status of the documents on the index page

2.2.2.5 Example of an export specification file

Here is an example of an export specification file:

region title
  <H1>ZAPPA</H1>
end-region

omitstatus

file registers file codingpolicy file documents

target /home/antti/public_html/fozbaz/

This file specifies that three documents should be exported (registers, codingpolicy, documents) to the directory /home/antti/public_html/fozbaz/. One region is specified (title); the string ZAPPA will be shown as a first-level heading before the documents listing. Other regions assume their default texts, which are reasonable. The ``omitstatus'' command removes document status information from the index page.