.BG
.FN prompt
.TL
Construct Documentation for Function or Data
.CS
prompt(name, filename)
.AG name
name or character string giving name of a function or data object.
.AG filename
filename for resulting documentation; default is `name.d'.
.SE
A file is written, containing an outline for documenting the function
or object.
The file will eventually be used by the `help' function to produce
documentation for the function.
As produced by `prompt', the file will contain the call to the function
and individual sections for each of the arguments.
You will need to fill in the actual information about the arguments,
a description of the value returned by the function, examples, and whatever
other information appropriate.
Lines in the file that contain "~"
should be replaced with appropriate information.
.PP
Documentation for functions and data resides (as ordinary text files) in
a subdirectory called `.Help' under the directory containing the
S objects themselves.
For example, if you are documenting a function `myfun' in the directory `/usr/me/.Data',
the completed documentation file should be moved into the `.Help'
directory with the command
.Cs
mv myfun.d /usr/me/.Data/.Help/myfun
.Ce
To see more about how documentation files are organized, look at some
examples.
The documentation files for functions in this appendix are in the
directory `s/.Functions/.Help' under the S home directory.
Type
.Cs
!echo $SHOME/s/.Functions/.Help
.Ce
.Px "documenting your own" functions
from inside S to see where
this is on your machine.
.br
.ne 5
.EX
prompt("grep")	# construct grep.d file
!vi grep.d  # fix up the documentation
!mkdir .Data/.Help	# if necessary, construct subdirectory
!mv grep.d .Data/.Help/grep	# install
.KW documentation
.WR
