Documentation standards consist of two parts: in-line and external. In-line documentation aids in module debugging and maintenance. External documentation of support routines is typically used to assist in determining which subroutines to call and how to do so; whereas, external documentation of application modules is used to assist the user in operating the software in the correct manner.
In-line documentation includes two particular areas: (1) The prologue is text describing the program unit that is placed at the beginning of the file before any code. This implies that there is only one prologue per file. Local subroutines do not need a full prologue since they will not be called by any routines except for those in the same file, but subroutines do need an algorithm description. The routines should be simple enough so that a few comments can explain how and what they do. (2) All code should contain text which identifies and describes each major block and any complicated code sequence.
Following is a list of the various aspects to be covered in the prologue and an explanation of the information that the programmer should include for each of these aspects. Not all of these sections are needed for every routine and therefore are marked optional. For example, since C supports good in-line documentation for variables, the variable sections are redundant and can be misleading if not maintained. These optional sections can be left out of a program prologue if they do not apply. For example, if a program has no algorithm references, the "ALGORITHM REFERENCES" section need not appear in the prologue.
--Program Prologue--
External support module documentation is documentation of a support module that is kept external to the program. This documentation would be useful to a programmer trying to understand the function of a piece of code or an entire package. It would also be useful to a programmer trying to use an entry point out of a library. It would not be useful to a typical user trying to run a program or package. The most important function of external program documentation is to provide programmers with instructions on how to use system or package-wide libraries. This type of information is absolutely necessary if programmers are to make efficient use of the libraries that LAS has available.
--Functional Guide Page--
The documentation for LAS 7.0 is contained on-line in HTML (hyper-text markup language) format. NCSA Mosaic-2.0 for X is used as the document viewer via the lasdoc command. Every LAS function or module has at least one proc definition file (PDF) that contains the help for LAS procs. Except for the diagrams, the user guide information is kept in the PDF; the HTML file is generated from the PDF with the pdfhtml function. (Section 7.3.1)
LAS procs should keep all help directly in the PDF. The parameter names are based on a listing of standard parameter names for LAS and are agreed upon by the programmer and the LAS coordinator. The help is divided into two levels. The first level gives a brief description of the associated module and each parameter. Modules and parameters are discussed in detail in the second level help. The first sentence of the second level help is the first level help.
The parameters should be ordered so that all mandatory input files and specifications appear first on the screen, followed by mandatory output files and specifications, and then followed by any other mandatory parameters. Keep associated parameters grouped together as much as possible, especially any window specification. All required parameters should appear before optional ones.
The user documentation development can be quite complex. To help programmers maintain consistency, all documentation should be reviewed by several people. These reviewers should include lower level managers who are tasked with supervising the entire project and representatives of the ultimate users of the documentation, whether it be scientists or applications programmers. In addition, the pdfhtml function, which generates a HTML formatted file which then can be used by Mosaic-2.0 to generate a hardcopy user guide, assists the programmers in maintaining consistency. The following sections detail the accepted standards for using the pdfhtml function.
The pdfhtml function generates an HTML file directly from a PDF file. The programmer first creates the PDF as normally done and then adds the necessary information for a complete user guide by using a set of TAE comment directives. Pdfhtml reads the PDF file and determines which parts of the PDF belong in which sections of the corresponding user guide. Additional information for the user guide is determined from the TAE comment directives and text placed in the PDF.
There are several specific formatting considerations for the PDF file. These include things such as order, capitalization, spacing, and the TAE comment directives.
This document provides a listing of the TAE comment directives and their meaning, a skeleton PDF (to be used as a basic example) and a listing of user notes for pdfhtml and corresponding document examples.
The following is a list of the TAE comment directives used for the pdfhtml function. A skeleton PDF in Section 7.3.3 shows the usage of the primary directives. The user notes in Section 7.3.5 provide detailed examples for these and also for the remainder of the directives that are not shown in the skeleton PDF.
!.HEADER Header and subsystem
!.EXAMPLE(S) Starts the Examples Section
!.DESC Starts the Description/ Algorithm section.
--The following directives pertain to error messages.
!.NONFATALS Nonfatal Error Messages --for "None." or more than one
!.NONFATAL Nonfatal Error Message --one nonfatal message
!.FATALS Fatal Error Messages --for "None." or more than one
!.FATAL Fatal Error Message --one fatal message
!.ERROR Error Messages --No error messages and some statement
is made
!.USERNOTE(S) Starts the User Notes section.
.VAR "parm name-subcommand "Needed for parameter descriptions that vary
with different subcommands
Examples:
.VAR IN-SINGLE
.VAR IN-MULTI
!.DYNLOCAL For dynamic parameter set within one pdf file
!.FINAL End of text directive
--TAE comment directives that pertain to formatting user guide
!.FIG < figure > Add a gif figure
!.LINE Add two blank lines
!.LIST Used for formatting at the start of parameter responses
or a list
!.LEND Used for formatting at the end of parameter responses
or a list
!.GOBBLE For inserting a comment to display in tutor mode but
ignored by pdfhtml
- !.HEADER Display
- Process XXX HELP=*
- SUBCMD XXX
- PARM XXXXXX
- END-SUBCMD
- SUBCMD XXXX
- PARM XXXXXX
- PARM XXXX
- END-SUBCMD
- END-PROC
- .TITLE
- Xxxxxxxxxxxxxxxxxxxxx
- .HELP
- Xxxxxxxxxxxxxxxxxxxxxxxxxxxx. Xxxxxxx
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- xxxxxxx.
- .page
- !.EXAMPLES
- Examples:
- 1. LAS> XXX-XXX XXXXXX=XX XXX=XXX
- Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
- 2. LAS> XXX-XXXX XXXX=XX
- Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
- .page
- !.DESC
- Description/Algorithm:
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
- Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- xxxxxxxxxxxxxxxxx. Xxxxxxxxxxxxxxxxx
- .page
- !.NONFATALS
- Nonfatal Error Messages:
- None.
- .page
- !.FATALS
- Fatal Error Messages:
- 1. [xxx-xxxxx] Xxxxxxxxxxxxxxxxxxxxxx
- Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
- 2. [xxx-xxx] Xxxxxxxxxxxxxxxxxxxxxxxx
- Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- xxxxxxxxxxxx. Xxxxxxxxxxxxxxxxx.
- .page
- !.USERNOTE
- User Note:
- 1. Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- xxxxxxxxxxxxxx. Xxxxxxxxxxxxxxxx.
- .LEVEL1
- .SUBCMD XXX
- Xxxxxxxxxxxxxxxxxxxxxxxxx
- xxx
- .SUBCMD XXXX
- Xxxxxxxxxxxxxxxxxxxxx
- .VAR XXXXXX
- Xxxxxxxxxxxxxxxxxxx
- = XXX: Xxxxxxxxxxxxxxxxxxxx
- = XXXX: Xxxxxxxxxxxxxxxxxxxx
- xxxx
- .VAR XXXX
- Xxxxxxxxxxxxxxx.
- .LEVEL2
- .SUBCMD XXX
- Xxxxxxxx(first level help)xxxxx. Xxxx
- (second level help) xxxxxxxxxxxxxxxx.
- Xxxxxxxx
- .SUBCMD XXXX
- Xxx(first level help) xxxxxx. Xxxxxxx
- (second level help) xxxxxx.....
- .VAR XXXXXX
- Xxx(first level help)xxxxx. Xxxxx
- (second level help)xxxxxxxxxxxxxxxxxx.
- Xxxxxxxxxxxxxxxxxxxxxx.
- !.LIST
- = XXX: Xxx(1st level)xxxxxx. Xxxxx
- (2nd level) xxxxxxxxxxxx.
- = XXXX: Xxx(1st level)xxxxxxx. Xxxx
- (2nd level) xxxxxxxxxxxxxxxxxxxxxxxxx.
- .!LEND
- .VAR XXXX
- Xxx(1st level)xxxxxx. Xxxxx(2nd level)
- xxxxxxxxxxxxxx.
- !.DYNLOCAL xxxxx
- .END
- !.FINAL
!.HEADER Tape_drive
!.HEADER LAS
For example:
1. LAS> XXXXXXXXX !.GOBBLE A diagram is available in the hardcopy user guide. !.FIG ../gif/file.name
% pdfhtml sample
--The first parameter initiates pdfhtml.
--The second parameter indicates the module.
sample.html file to be displayed with Mosaic-2.0