	    Brief notes on standard documentation on the VAX

		Notes on how to organise and runoff the
		documentation for standard software.

		     Tony J Ibbs, 8 March 1988

===============================================================================

These notes are being circulated prior to the release of a new version of the
standard (chapter oriented) command file STANDARD_RNO, and the associated bits
of DOC. They attempt to explain how standard documentation should be organised
on the VAX. Note that they reflect the situation as it WILL be, when I have
place the new stuff into operation. If you have any worries or complaints,
please contact me soon---I intend to place the new command files into operation
on Monday 14 March 1988.

All of the documentation for standard software should be located on the 780,
and it will be somewhere in the directories hanging off LSL$DOC_ROOT. For an
ideal standard document, there would be the following subdirectories:

	LSL$DOC_ROOT:['package'.REFERENCE]	the reference manual
	LSL$DOC_ROOT:['package'.GUIDE]		the user guide
	LSL$DOC_ROOT:['package'.ACCEPT]		the acceptance tests
	LSL$DOC_ROOT:['package'.SPS]		the SPS
	LSL$DOC_ROOT:['package'.RELEASE]	the release notes
	LSL$DOC_ROOT:['package'.HELP]		the help (.HLP) file(s)

In practice, not all of these will always be present in existing documents.
There should also be the following runoff files:

	LSL$DOC_ROOT:['package']PACKAGE_TITLE.RNO
	LSL$DOC_ROOT:['package']SPINE_TITLE.RNO

The first is the title page to go at the beginning of the whole manual, when
all parts are placed into one binder, and the second is a runoff file to
prepare an insert for the spine of the binder. Some packages (such as IMP) run
to more than one manual, so they will have multiple title pages, named in some
appropriate manner.


The reference manual
====================

This lives in LSL$DOC_ROOT:['package'.REFERENCE] and should be present for
all standard documents. The directory should contain a standard set of files:

	'package'_REF.SPEC	this is the file which tells how the document
				should be assembled. It is described below.
				(Note that the name is sometimes slightly
				 different than this)

	CHANGES.RNO		this logs the changes made to the document

	PREFACE.RNO		this is an optional preface to describe
				conventions used within the document

	SPR_FORM.RNO		a Software Performance Report form---three will
				be inserted at the back of the manual.

	INTRODUCTION.RNO	the first chapter should always be called this

There should then be one file for each chapter or appendix of the document.

For all new documents, the SPEC file should use AUTO_TITLE, and it should
specify:
			NO_SECTION_NUMBERS
			AUTO_NAME_CHAPTER
			FLAG_PAGES

The chapter and appendix runoff files should not contain any .CHAPTER,
.APPENDIX or .TITLE commands. Instead, the SPEC file should contain commands
of the form
			CHAPTER  FILENAME  This is the chapter name

The commands
			CONTENTS
			CHANGES
			PREFACE		(if there is one)
			INDEX

are also normally present.  For an example, see the SPEC file for the IMP
reference manual (attached).

Arrangement of chapters
-----------------------

There are several conventions for the chapters within a reference manual, 
depending upon its purpose. The three simple examples are IMP, CONVERT and
LITES2.

One program to a MODULE
.......................

The IMP manual documents each IMP program (called a MODULE) in a single
chapter. It uses the LSL standard 'DEC-like' documentation layout, with
horizontal lines separating sections (the SPEC command NO_SECTION_NUMBERS sets
the .HL command up to act in the appropriate way). Each program has the
following sections (some may be omitted from particular modules, if plainly
not needed):

	MODULE name, REPLACES, FUNCTION, FORMAT,
	PROMPTS, PARAMETERS, COMMAND QUALIFIERS,
	RESTRICTIONS, DESCRIPTION, EXAMPLES,
	MESSAGES (INFORMATIONAL, WARNING, ERROR, FATAL and OTHER)

Several programs to a MODULE
............................

The CONVERT package is also organised into MODULES, but in this case each
MODULE may contain more than one program, called UTILITIES. This is because it
is usual to sell a customer two programs for most translations---one from and
one to IFF. Each CONVERT MODULE standardly contains the following files:

	IFF'module'.RNO		the file that .REQUIRES the other files
				for this module
	'module'_FORMAT.RNO	this describes the (possible subset) of the
				format supported
	'module'_PREP.RNO	this describes how to prepare IFF data for
				transfer to the format
	'module'_'utility'.RNO	these are the files that describe each program
				associated with the module

Other packages where multiple programs are collected together as a single
module should adopt a similar approach.

NOTE: in fact, the main CONVERT manual is called the [.GUIDE], although it is
      clearly a [.REFERENCE] manual. Ah well.

Single program manuals
......................

LITES2 is an example of a program that is a package to itself. In this case,
it is up to the person writing the documentation how they use the facilities
available.


The user guide
==============

This lives in LSL$DOC_ROOT:['package'.GUIDE] and is similar in structure to the
reference manual. It is intended to provide an overview or introduction to the
package. The structure of the document will be the same as for the reference
manual, except that the SPEC file should be called something like:

		'package'_GUIDE.SPEC

There will also be fewer chapters---for instance, the IMP user guide has an
INTRODUCTION (as required) followed by a single chapter describing each IMP
utility on a page or two.


The acceptance tests
====================

These live in LSL$DOC_ROOT:['package'.ACCEPT] and should be called

		'package'_ACCEPT.RNO

Since only one file is used, there is no need for a SPEC file. If you are
not in DOC, use DOCRNO rather than STANDARD_RNO to run it off.


The software product specification (SPS)
========================================

This lives in LSL$DOC_ROOT:['package'.SPS] and should be called

		'package'_SPS.RNO

Since only one file is used, there is no need for a SPEC file. If you are
not in DOC, use DOCRNO rather than STANDARD_RNO to run it off.

Note that whenever a new SPS is generated, a copy should be lodged with SALES
SUPPORT as well as with the Drawing Office.


The release notes
=================

These live in LSL$DOC_ROOT:['package'.RELEASE]. Some standard naming convention
should be adopted so that it is obvious which release note belongs to which
version of the program. For instance, files might be called

		'package''major'.'minor'

(for instance, FRED2.01 would mean release 2.01 of package FRED, where 2 is
the major release number, and 01 is the minor) or

		'package'_'increment'_'date'.RNO

(for instance, FRED_005_02jan88.RNO for the 5th release of FRED, on 2nd January
1988---this inclusion of the 'increment' causes DIRECTORY to display the files
in the right order).


The help file
=============

This lives in LSL$DOC_ROOT:['package'.HELP], and is normally called something
like
			'package'.HLP


Exceptions
==========

Obvious 'strange cases' are packages such as LSLMAINT, which has a single
subdirectory [.LSLLIB], containing the LSLLIB technical reference manual.
Be very careful when creating a non-standard directory on LSL$DOC_ROOT, as
people may get confused when trying to look at it with DOC---see below.


How DOCUMENT (DOC) relates to all of this
=========================================

This section talks about the use of the 'new' DOC utility with respect to
standard software documentation.

When you start using DOC, it asks you whether you want to edit in PACKAGE or
DOC mode. DOC mode allows you to move where you like, and PACKAGE mode is
intended for editing and printing standard documentation. However, because of
this, it also imposes various restrictions on what it can and will do.

What DOC will let you see
-------------------------

In PACKAGE mode, DOC assumes the directory structure described above for
standard documentation. In particular, it will not let you get into
subdirectories that it does not expect---so if you have a directory [.PDP] in
your [.GUIDE] directory, you cannot get at it in PACKAGE mode (you'll have to
use DOC mode, and access it by successively selecting directories PACKAGE,
'package', GUIDE and PDP). Not only won't it let you get at such
subdirectories, but it won't even show you that they are there (it is a common
property of DOC not to show you files that it does not know about).

The advantage of PACKAGE mode is that it does know all about SPEC files, and
when you come to run off a document in PACKAGE mode it first looks to see if
there is a SPEC file to describe how to do it. If there is, it will talk about
the document by the name given as the SPEC filename (eg FRED_REF if the SPEC
file is FRED_REF.SPEC), and you can run off the whole document. If there isn't
a SPEC file (as for an SPS, for instance) then it will just run off the file
requested as it stands.


Creating new standard documents
-------------------------------

When you ask for a directory or file that does not exist, DOC will ask if you
want to create it. If you are in PACKAGE mode, then DOC will take various
special actions when creating various types of document.

If you ask for a new package (that is, you have just selected the PACKAGE
option in the top level menu, and you ask for a document/directory that does
not exists), then DOC will create the following directories for you:

	['package']
	['package'.SPS]
	['package'.GUIDE]
	['package'.REFERENCE]

It will then create a template runoff file called PACKAGE_TITLE.RNO in the
['package'] directory (this was described above). It then creates the following
templates (by copying files from the directory LSL$DOC_TEMPLATE):

	In the SPS directory, it creates
				  'package'_SPS.RNO
				  'package'_SPS.HDR
				     TITLE_PAGE.RNO

	In the GUIDE directory, it creates
				'package'_GUIDE.SPEC
				        CHANGES.RNO
				        PREFACE.RNO
				   INTRODUCTION.RNO

	In the REFERENCE directory, it creates
				  'package'_REF.SPEC
				        CHANGES.RNO
				        PREFACE.RNO
				   INTRODUCTION.RNO
	
It is then up to you to edit these files to make them sensible for the
particular document that you are creating.

If you are in a package that already exists, and ask for a new directory,
then it will create you an empty directory of that name---this is the same
in PACKAGE and DOC modes.

If you are in a package and directory that already exist, and ask for a new
file, then it will present you with a list of types of file. Three types (SPS,
GUIDE and REFERENCE) are flagged as being "for a PACKAGE". If you choose one
of these options, then DOC will create the group of files that are described
above for whichever is chosen.

If you choose the CHAPTER or APPENDIX option, and are in PACKAGE mode, then it
will ask if you want a STANDARD chapter, and if you say yes it will create an
empty file for you, instead of one that starts with a .CHAPTER or .APPENDIX
command. This is because it assumes that you will have the AUTO_NAME_CHAPTER
option in you SPEC file.


Help text from STANDARD_RNO
===========================

If you use the command STANDARD_RNO ? then you will get the following text
printed out:

	------------------------------------------------------------

This command file is designed for use in running off Laser-Scan documentation
in a standard manner. It is primarily aimed at the production of user guides
and reference manuals - chapter oriented documents, with a standard structure
and layout.

For example .SPEC files, see LSL$DOC_ROOT:[LSLMAINT.LSLLIB]LSLLIB.SPEC
			 and LSL$DOC_ROOT:[CONVERT.GUIDE]CONVERT.SPEC

This procedure provides two main options:

	(1) to produce a full version of the document, called 'document'.MEM
	    (where 'document' is the name of the document).

	(2) to produce a subset of the document, called PART_OF_'document'.MEM

Alternatively, .LNI files are produced if output is to be to the LN03 printer.

===============================================================================
It is assumed that the user has defined the following files:

'document'.SPEC

	This file contains commands which define how the document is to
	be prepared.

TITLE_PAGE.RNO

	This is only used if the AUTO_TITLE command is not used in the SPEC
	file. If required, the file should be the actual title page for the
	document.

CHANGES.RNO, PREFACE.RNO

	If a changes section or a preface is wanted, then the relevant
	runoff files must be supplied.

'chapter'.RNO

	There should be one runoff file for each chapter. The first chapter
	should always be called INTRODUCTION. In most standard documents, the
	file should not include a .CHAPTER command, as one will be generated
	automatically.

	See the SPEC file commands AUTO_NAME_CHAPTER and PREFIX_CHAPTER

'appendix'.RNO

	For each appendix (if any) there should be a runoff file. Note that
	the same comments apply for appendices as for chapters (see above).

The following files are generated by the procedure itself:

'document'.RNO or PART_OF_'document'.RNO

	This is the 'top-level' runoff file, which uses .REQUIRE to include all
	the selected parts of the document. It should be treated as a temporary
	file, since STANDARD_RNO will create a new 'top-level' file each time
	it is run.

'document'.RNT, 'document'.RNX

	These are used to generate the contents and index for the document
	(if they are wanted).

================================================================================
			Specification file commands

The following is a list of the commands that may be given in the specification
file. Those commands which would be expected in the specification file for a
normal standard document are marked with an asterisk (*). Note that blank lines
will be ignored, and comments are ignored, where a comment is preceded by a "!"
================================================================================

*    AUTO_TITLE
  NO_AUTO_TITLE

	If automatic titles are selected, then

		1) the title page of the document is generated automatically,
		   without reference to a TITLE_PAGE.RNO, from the various
		   title page commands detailed below

		2) if AUTO_NAME_CHAPTER is selected, then the titles for the
		   tops of each page will be automatically set to be of the
		   form
			'short_title' ('issue'): 'chapter-name'

	This mode is intended for generating documents to satisfy military
	style requirements, where every page must be clearly identified. It
	should only be used in a document using AUTO_NAME_CHAPTER, FLAG_PAGES
	and CHANGES.

	===================== AUTO_TITLE commands =====================

* TITLE  text

	This command is used in an AUTO_TITLE environment to indicate the
	title of the document. Several TITLE commands may be used, for
	instance
			TITLE	LSLLIB
			TITLE	Technical_ Reference_ Manual

  VOLUMES  how-many

	If this command is included, then it causes 'how-many' title pages
	to be generated (all at the start of the document!).

	If AUTO_TITLE has been selected, then these pages will be identical,
	except that they will have the text "Volume I", "Volume II", etc,
	centred below the TITLE lines.

	If AUTO_TITLE has not been selected, then the files TITLE_PAGE1.RNO,
	TITLE_PAGE2.RNO, etc, will be .REQUIRED

* DATE  date

	This command is used in an AUTO_TITLE environment to indicate the
	date on which the document was last edited.

* AUTHOR  name(s)

	This command is used in an AUTO_TITLE environment to indicate who
	last edited the document.

* SHORT_TITLE  short-title

	This command is used in an AUTO_TITLE environment to indicate the
	short form of the document's title. This is used at the bottom of
	the title page (for D.O. cross referencing) and in the automatically
	generated document titles.

* ISSUE  number

	This command is used in an AUTO_TITLE environment to indicate the
	document's issue number. This is used at the bottom of the title
	page (for D.O. cross referencing) and in the automatically generated
	document titles.

* CATEGORY  category-name

	This command is used in an AUTO_TITLE environment to indicate what
	category (eg, Technical, User) this document belongs in, for D.O.
	purposes.

   NOTE  text

	Occasionally, it is necessary to insert some extra text on the title
	page. In an AUTO_TITLE environment, this may be done by using the NOTE
	command. Like the TITLE command, multiple lines may be inserted by
	repeated use of the command. The text of the note (with leafing and
	trailing spaces and tabs removed) is inserted into the file as it is
	presented. It is placed above the identification lines at the bottom
	of the title page, and within a .KEEP .NOFILL environment - that is,
	line breaks and internal spaces will be retained. See the LSLLIB SPEC
	file for an example.

	===================== File inclusion commands =====================

* CHANGES

	If this is specified, then CHANGES.RNO will be included.

* PREFACE

	If this is specified, then PREFACE.RNO will be included.

* CONTENTS

	If this is specified, then the contents of the document will be
	included at its start.

* INDEX

	If this is specified, then the index for the document will be
	included at its end.

* SPR_FORMS

     	If this is specified, then three SPR forms (from SPR_FORM.RNO)
	will be included at the end of the document.

	===================== Chapter/Appendix commands =====================

*    AUTO_NAME_CHAPTER		(default)
  NO_AUTO_NAME_CHAPTER

	If automatic naming of chapters is enabled, then the command file
	will generate an appropriate .CHAPTER or .APPENDIX command for each
	chapter or appendix. The chapter and appendix files must therefore
	not include a .CHAPTER or .APPENDIX command.

	If automatic naming of chapters is not enabled, each file must
	include an appropriate .CHAPTER or .APPENDIX command.

	See also CHAPTER, APPENDIX, PREFIX_CHAPTER, FLAG_PAGES, AUTO_TITLE

* PREFIX_CHAPTER  prefix

	If this is specified, and AUTO_NAME_CHAPTER has been specified,
	then the text used to name each chapter will be

		'prefix'  'chapter-name'

	If AUTO_NAME_CHAPTER has been specified, but AUTO_TITLE has not,
	then the prefix will not be used for chapter 1, the introduction.
	This is because the first section of the introduction is also
	normally called INTRODUCTION, and it looks strange to have the
	title and subtitle the same.

*    FLAG_PAGES
  NO_FLAG_PAGES

	If AUTO_NAME_CHAPTER is specified, then FLAG_PAGES will cause the
	.CHAPTER or .APPENDIX command to be output on a separate page. That
	is, the first page of the chapter or appendix is a flag page which
	can either be retained as a 'cover page' or discarded.

     SECTION_NUMBERS
* NO_SECTION_NUMBERS		(default)

	If section numbers are requested, then each section header will have
	a section number attached, and the section numbers will also be present
	in the contents. The default blank lines above and below the section
	header (.HL) commands will also be output.

	If section numbers are not requested, then they will not be present in
	the document. Also, an appropriate .STYLE HEADERS command will be used
	to set the 'DEC-like' style of headers that we use for our standard
	documentation - the blank lines before each section header will be
	suppressed, etc.

* CHAPTER  file-name  [chapter-name]

	The chapters to be included in the document must be specified,
	in the order that they are wanted, using the CHAPTER command.

	If AUTO_NAME_CHAPTER is specified, then 'chapter-name' is the
	name that will be used for the chapter. If it is omitted, then
	'file-name' will be used instead.

	Note that the first chapter must always have file-name INTRODUCTION.

* APPENDIX  file-name  [appendix-name]

	If appendices are required, then they must be specified in the
	order that they are wanted, using the APPENDIX command. The
	'file-name' is the name of the appendix's runoff file.

	Note that previous versions of STANDARD_RNO required all appendices
	to include a .APPENDIX command. With this version, appendices are
	treated exactly like chapters (except that PREFIX_CHAPTER is not
	relevant).


Example SPEC files
==================

! LSLLIB.SPEC
! specification for the LSLLIB reference manual

auto_title
title		LSLLIB
title		Technical_ Reference_ Manual
date		4-Mar-1988
author		TJ Ibbs
short_title	LSLLIB REF
category	Technical
issue		1.8

note	This is copy number:
note
note	^&Copy\&		^&Location\&
note
note	###1		Software reference copy	- software reference library
note	###2		Proof/amendment copy	- Tony J Ibbs
note	###3		Software copy		- main library shelves
note	###4		Software copy		- shelves in window cluster
note	###5		Chief Programmer's copy	- Paul Hardy
note	###6		New Products' copy	- Robin Fairbairns
note	###7		US Bureau copy		- US Bureau, Reston, VA
note
note	The Facility Number Manager is: TJ Hartnall
note	Consult him before allocating a new facility number for message definition.

changes
contents
index

! Note that the LSLLIB manual is somewhat strange
! - we want section numbers, and automatically named chapters,
!   but we don't want the chapter title to be on a flag page

section_numbers
auto_name_chapter
no_flag_page

Chapter		INTRODUCTION	Introduction
Chapter		LSLINIT		The start and end of programs
Chapter		ERROR_DEFN	Error message definition
Chapter		ERROR_RTNS	Error message routines
Chapter		EXCEPTION	/EXCEPTION/ - errors and exceptions
Chapter		EXPC		/EXPC/ - the output common block
Chapter		EXPAND		Using /EXPC/ - text expansion
Chapter		TXTC		/TXTC/ - the input common block
Chapter		CHARACTER	Basic routines for reading from /TXTC/
Chapter		NUMBERS		Reading numbers
Chapter		STRINGS		Reading strings
Chapter		FILENAME	Filename parsing routines
Chapter		TERMINAL	Terminal input/output
Chapter		FILE		File read and write routines
Chapter		DCL		DCL command line interpretation
Chapter		COMMANDS	Command decoding
Chapter		IFF		IFF file opening routines
Chapter		MAPPED		Mapped section files
Chapter		MAGTAPE		Basic magnetic tape I/O routines
Chapter		SYSTEM		Routines to ease use of system facilities
Chapter		SORT		Sort routines

Appendix	MESSAGES	LSLLIB success/error codes
Appendix	COMPARISON	Differences from VIOLIB/CMDLIB


! IMP_REF.SPEC
! specification for the IMP reference manual

! note that we want three title pages, one for each of three volumes,
! so we must use the VOLUMES command
volumes		3

auto_title
title		IMP
title		Reference_ Manual
issue		2.0
short_title	IMP REFERENCE
category	REFERENCE
author		Various
date		14-Jan-1988

changes
preface
contents
index

! The next three commands are strictly redundant, as they describe the
! default situation. However, they should be included as they make it
! more obvious what is going on.

no_section_numbers
auto_name_chapter
flag_page

! We use the default chapter title (ie the file-name) for each MODULE

prefix_chapter	MODULE

Chapter		INTRODUCTION
Chapter		ICHECK
Chapter		IDIFFERENCE
Chapter		IFILTER
Chapter		IFIXAREA
Chapter		IFROMTEXT
Chapter		IINFO
Chapter		ILAYFC
Chapter		IMEND
Chapter		IMERGE
Chapter		IPATCH
Chapter		IRECODE
Chapter		IRENUMBER
Chapter		IREPORT
Chapter		ISELAC
Chapter		ISELECT
Chapter		ISORT
Chapter		ISTART
Chapter		ITOTEXT
Chapter		ITRANS
Chapter		IWINDOW

! the appendices (previously all together in the file ITRANS_APPENDICES)
! are now separated into three files:

Appendix	ITRANS_SPHEROIDS	ITRANS - Spheroids offered
Appendix	ITRANS_PROJECTIONS	ITRANS - Projections offered
Appendix	ITRANS_FORMATS		ITRANS - Number formats
