The purpose of this document is to describe how technical documents are written in the SCHEMESTATION project.
Note:It is now possible to define a category for the document. The category should be given with the following syntax:
<title technical>(title)</title>,where the word technical is the desired category. Documents with no category will default to the category "general". Please have a look to the categories section for more information on categories.
(The syntax may be cumbersome, but there was no easy way to patch builddocs to recognize a cleaner one due to the line-by-line approach adopted in the early phases of builddocs evolution.)
The browser recognizes standard C (ansi) and scheme syntax so that it can find the function definitions and data structures. The code must be under certain root-director{y,ies} so that it can be found during the file traversal. To make it possible to find the function descriptions, they have to placed in a comment straight before the definition of the function both in scheme files and C header files.
The generated documentation can be using the tag <headers name file1,file2,...>, where name is the name of the module (that will appear as a <H1>-header) and files the C-header or scheme files to be traversed.
The function descriptions consists of the name of the function (the name is also a link to the code browser representation of the source. It also contains the arguments, return value, and the description that is captured from the comment preseding the function definition in the header/scheme file.
You can reference the functions in text by using <func>functionname</func>-tags. This generates a link to the corresponding function description. To maintain the outlook of the documentation, one should use <x>functionname</x>-tag to use courier-type font.
<math> a^2 + b^2 = c^2 </math>results in
m4_define({{foo}},{{barf $1!}}) foo(zappa)and get in the resulting HTML file "barf zappa!". See the documentation of the M4 macro processor for more information.
The aids for documenting are explained in <ssref documents>.
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:
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.
The syntax for the file is as follows:
course:subdir=course,title=Course related documentsFirst 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).
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:
File specification is of form
file BASENAMEand specifies that the document BASENAME (whose source is in BASENAME.ssdoc) should be exported.
Target specification is of form
target DIRECTORYand specifies that the installation should take place to the directory DIRECTORY. It is mandatory to specify a target.
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 NAMEwhere 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.
A command is a simple optional one-word command. Currently the following commands are recognized:
Here is an example of an export specification file:
region title <H1>ZAPPA</H1> end-regionomitstatus
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.