groff – man pages

from MacOSXHints…

There was a previous hint that mentioned using ‘col -b’ to convert a manpage to plain text. Unfortunately, plain text doesn’t give nice fontification (underline, italics, etc).

You can convert manpages to much nicer looking html (or postscript) for pretty printing or perusing in a web browser by using groff. In fact, the man command uses the ASCII driver for groff (or maybe troff) to get the output that it displays. Try the following examples:
% groff -Tascii -man /usr/share/man/man1/ls.1 > ls.txt
% groff -Thtml -man /usr/share/man/man1/ls.1 > ls.html
% groff -Tps -man /usr/share/man/man1/ls.1 > ls.ps

The ‘-man’ option is required, as it tells groff to use the ‘an’ set of macros. Look at man groff for more output types (devices) and options.

[Editor’s note: Another previous hint explained how to download and install the newest version of groff if you want to be current. The HTML output option given in this hint is quite nice; use it on the “tcsh” man pages to make them easier to browse.]