Subject: Re: How to WRITE man pages
To: None <joe@laffeycomputer.com>
From: Larry Kollar <Larry.Kollar@arris-i.com>
List: port-mac68k
Date: 11/17/1998 10:15:09
Sorry if this has already been covered; I read the digests off
the web so I'm always a day behind....

> Anyone have some ponters to how to write man pages? Is there a
> man page on this?

Try "man 7 man" -- if there *is* a man page for -man, that's it.

> I want to write up a man page for my text replacement utility
> and release it as a GNU license package.

Shoot, I *used* to write manpages and manuals in nroff for a
living!  Your best bet is to examine the manpage for, say, cat
(/whatever/man/man1/cat.1) to see how it's done -- compare with
the output.  That's how I learned it.

This example is off the top of my head, coming from some VERY
rusty memory, so don't be too hard on me if it doesn't work.
If I were at home right now, I could look up a source page....

	.NM fred - the FRied EDitor		\" (the NAME field)
	.SY fred [-x] [file]			\" (SYNOPSIS)
	.DE								\" (DESCRIPTION)
	The \Ifred\P utility edits text files while frying itself
	on top of a PentiumII with no heatsink.
	.PP
	(Note the \\I and \\P above.
	These tags specify italic and previous (i.e. undo the
	last tag), respectively.
	The \\B tag is for bold.
	The \\" tag treats the rest of the line as a comment.
	The \.PP tag starts a new paragraph.
	Two \\ characters prints a single backslash, like printf.)
	.PP
	The \B-x\P option replaces any rude language with x characters.
	This is useful when dealing with xxxxing morons.

To test it out, use "groff -Tascii -man (file) | more"

Y'know, it's amazing that nobody ever wrote a manpage-HOWTO...
you would think that programmers automatically know this stuff
or something.  Oh well, now I have another project. :-)

Seriously, -man is a very simple package (especially compared
to -ms and even to HTML) so it shouldn't be hard to pick up
from examples and experimentation.  But let me know if you
need some help.

	Larry