Manual pages are written in source form, which looks like the example below. Several simple nroff/troff macros are used from the -man macro package. Note that nroff macros which must are put with their leading dot in column 1.
+--------------------------------------------+ |name(section) name(section)| | | / / | | | date page-number | +--------------------------------------------+
term paragraph... paragraph longterm paragraph paragraphkind of list.
Anyhow, those are the macros ones I ever use. A sample manpage follows:
- - - - - - - - - - - - - cut here - - - - - - - - - - - - - - - - - .TH SILLYCOMMAND 8 LOCAL .SH NAME sillycommand - do something silly .SH SYNOPSIS .B sillycommand [options] .I option option .B [" .I f1 f2 .B ..."] .SH DESCRIPTION .I sillycommand is a shell script which does silly things, and takes some options: .TP 5 f1 is one option .TP f2 is another option .P This is another paragraph with an example: .br .nf sillycommand "with option" .fi .SH OPTIONS .TP .I -r makes the command really silly. .TP .I -n means the command should print the silliness, but not actually do it. .SH AUTHOR Marc Mengel .SH SEE ALSO stupid(1), bogus(2) .SH DIAGNOSTICS Mostly ridiculous. .SH BUGS - - - - - - - - - - - - - cut here - - - - - - - - - - - - - - - - -
(don't forget to "setup groff")
you format 'em with
groff -man -Tascii manpage > asciioutput
for ascii formatted man pages, or with
groff -man manpage > output
for PostScript typeset pages.
You can then take the ascii formatted page and run it through
man2html -title 'manpage' < asciioutput > htmlfile
to make html out of it.
Running manpages through groff a second time looks really bad. This is usually the cause of strange looking manpages -- things are in source/unformatted manual directories that are already formatted, and then when you run "man", it tries to format them -- again! The naming differences between .../man and .../catman on many systems are important here -- catman holds preformatted pages, and man holds source pages.