Notes on Documenting C++
=========================
Types of things a tech writer documents for a C program:
* how to use a program
* the command-line syntax
* how to use the GUI
* the API
* code samples
Generalized sytax:
* supply a value
* optionally, supply a value
* choose one
* repeat of the item is allowed
* repeat of the optional item is allowed
Supply a value
---------------
To indicate that the programmer must supply a value, use < >
Meaning:
Replace with an appropriate value.
Example:
MyProgram
where:
* arg is one of the following:
copy -- copies startup files to outdir
remove -- removes files from outdir
* outdir is an absolute or relative path
A valid interpretation:
MyProgram copy output/data
Optionally, supply a value
----------------------------
To indicate that a value is optional, use [ ]
[ ]
Meaning:
The item in the brackets is optional.
Example:
[ abstract ] () [;]
Interpretation:
* the word "abstract" is optional
* a value must be supplied in place of
* a value must be supplied in place of
* "()" must be provided after the name
* the trailing semi-colon is optional
Choose one
----------
To indicate a choice between items, use |
| |
Meaning:
Choose one of the items ( | means "or").
Example:
us_citizen = true|false
Interpretations:
us_citizen = true
us_citizen = false
Repeat of the item is allowed
------------------------------
To indicate that an item may be repeated, use ...
...
Meaning:
The item before the ... may be repeated one or more times.
Example:
print ...
Interpretations:
print myfile.txt
print yourfile.txt myfile.txt *.doc
Repeat of the optional item is allowed
---------------------------------------
To indicate that an optional item may be repeated, use ... inside [ ]
[ ...]
Meaning:
If you provide the optional item, you may also repeat it.
Example:
dir [ ] [