How Do I Format Man Pages without man?

This stuff won't work on FREESCO, but it's usefull for FREESCO package developers who want to convert man pages to HTML to include in their package documentation.

The perl based man2html program translates groff text to HTML, which you can view with a Web browser. The man2html program, and many like it, are available on the Web. Look for them with your favorite search engine.

The unformatted manual pages are stored in subdirectories of /usr/man, /usr/local/man, and elsewhere, usually with a numeric extension (man section).

Here is a typical way to convert a man page to HTML using man2html:

groff -mandoc -Tascii htpasswd.1 | man2html > htpasswd.1.html

This results in a page like this

If you want to view text, use nroff and less. Both of these programs have MSDOS versions with an implementation of the man macro package available as well. An example would be:

 nroff -man /usr/man/man1/ls.1 | less 

If you know where to find a good implementation of the man macros without installing groff, please let the FAQ maintainer know.

If the manual page filename ends in .gz, then you'll need to uncompress it before formatting it, using gzip -d or gunzip. A one-line example would be:

 gzip -dc /usr/man/man1/ls.1.gz | nroff -man | less 
 
freesco/howtos/manpages.txt (39749 views) · Last modified: 2005/09/14 00:49 (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki