XEROX DOCUMENT 2 (5 4 1) DOCUMENT (1 4 5) By: David Newman (Newman.pasa@Xerox.COM) 28-Aug-86 INTRODUCTION This program creates documentation for any Lisp package in the style of the Lisp Users documentation. It requires that the code for the package be loaded. It does not completely format the document, but it minimizes the amount of work that the documenter must do. To make most effective use of these functions, each function in the package being documented must have a comment as the first expression in the function after the timestamp, and the source code for the package being documented must be loaded into the system. Similarly, the COMS variable of the file should contain a comment (like this one) as the first item in the list. This package was documented using itself. The top level call to this package is Document.Create. To create this document, the expression (Document.Create 'DOCUMENT) was evaluated, and the resulting TEdit document was edited by hand. FUNCTIONS (Document.Create FileName) [Function] This function builds a document for a loaded file. The document is in the style of the Lisp Users package documentation. The function collects comments from the COMS variable of the file and from the functions in the file. It also collects some information from the Interlisp-D file package. This is the top-level function in the DOCUMENT package. FileName should be the name of the package not the name of the file (DOCUMENT not {dsk}document). (Document.Begin FileName Stream) [Function] This function initializes the begining of the document stream. (Document.FileComments FileName Stream) [Function] This function places all comments found in the COMS variable of FileName into Stream. It is intended for use in documenting a Lisp code file. Ideally, these commends would be distributed through the documentation as they are distributed through the COMS variable. (Document.Functions FileName Stream) [Function] This function documents the Functions on FileName into Stream. It does this by obtaining the function names from the file package, using the ARGLIST function to obtain the argument list, and obtainin the initial comment in the function if it exists. (Document.Variables FileName Stream) [Function] This function is intended for use while documenting Lisp code. It collects a list of the variables from FileName, and places them in Stream in the format of the Lisp Users Documentation. (Document.Things FileName Stream FilePkgType TypeName) [Function] This function is intended for use while documenting Lisp code. It collects a list of items of type TypeName, that are written using the FilePkgType file package command, from FileName, and places them in Stream in the format of the Lisp Library Documentation. (Document.Finish Stream Pointer) [Function] This function performs formatting and the like to make the document pretty, and to make the format correct as specified. (Document.RunningHead FileName Stream) [Function] This function creates the running header for the document. (Document.Title FileName Stream Pointer) [Function] This function creates the title area of the document consisting of the name of the package being documented in between two lines. (Document.Information FileName Stream Pointer) [Function] This function creates the information at the top of the document, including the form for the author's name and a list of other packages necessary to run this package. The following SETFILEPTR exists because TEDIT.PARALOOKS does not leave the file pointer at the end of the file. (Document.SectionHead Stream String) [Function] This function is intended to create the bold section headings in Stream that are needed for the Lisp Users document style. (Document.Format Stream) [Function] This function formats the document. It sets the page layout, font looks, and paragraph formatting for all selected text. (Document.FunctionCommentedP Function) [Function] This function is intended to tell if a function has an initial comment or not. VARIABLES DOCUMENTCOMS [Variable] (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY GACHA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE LETTER FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY GACHA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE LETTER FOLIOINFO (ARABIC)) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY GACHA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))1È È(È(ŠŠ8DÈÈ PAGEHEADING RUNNINGHEADMODERN TERMINAL MODERN MODERN MODERN LOGO  HRULE.GETFNMODERN  HRULE.GETFN  HRULE.GETFNMODERN *  «`G  ad ?   û ¼$  y ; ‚   { z O èrzº