+subject: man2html - convert manual pages into HTML files
MAN2HTML(1) MAN2HTML(1)
NAME
man2html - convert manual pages into HTML files
SYNOPSIS
man2html [baseurl [manpage ...]]
man2html.cgi
DESCRIPTION
man2html takes the output of the man(1) command and con-
verts it into HTML. Manpage text in bold or italics is
also in bold or italics in the HTML output. References to
other command appear linked if they are found in the man-
page list from the command line.
If baseurl is either omitted, empty or ``-'' man2html pro-
duces links to static files while otherwise the link
addresses are made by appending the manual page's name to
the baseurl (see below).
Output format
The HTML output is enclosed in a <PRE>-tag. Page headers
and footers are generally ommitted, only the header from
the first page is printed.
The HTML file's title is taken from the manual page if the
NAME section is found within the first 12 lines of the
input.
Input Format
To detect header and footers man2html makes some assump-
tions about the output of the man command. The expected
number of lines on a page is 66, including six lines of
page header and 6 lines of page footer. If this doesn't
match your man output you'll have to change the settings
at the beginning of the script (man2html is an awk
script).
Referencing Manual Pages
Each reference to a manual page found in the input will be
linked if the manual page if found in the manpage list
from the command line. If this list is empty every refer-
ence will be linked.
In file-mode (when baseurl is either omitted, empty or a
dash) man2html creates links to static files of the form
name-section.html
e.g. ls(1) would be HREF'ed as ls-1.html.
In cgi-mode the name of the manual page is directly
appended to the baseurl. The section number is separated
from the name with a ``+'' which is URL-encoded a blank.
CGI-Interface
man2html.cgi is a CGI-interface for man2html that allows
retrieving every manpage found on the system, listing man-
ual sections and searching in the whatis(1) database. The
mode of operation is controlled with the QUERY_STRING that
the program receives.
Retrieving
The manpage name is appended to the URL like in
/cgi-bin/man2html.cgi?ls
It might be followed by a section namuber as in
/cgi-bin/man2html.cgi?ls+1
if there are manual pages in more than one section.
If in this case the section is omitted man2html.cgi
return the list of available manpages.
Searching
The whatis(1) database is automatically searched if
one of the charactes ``.'', ``?'' or ``*'' is found
in the QUERY_STRING. In this case the QUERY_STRING
is expected to be a whatis(1) compatible search pat-
tern.
/cgi-bin/man2html.cgi?ls*
lists all manpages starting with ls.
Sections
To list the contents of a section the section number
is appended to the baseurl:
/cgi-bin/man2html.cgi?1
The section number may be followed by a grep(1) com-
patible search pattern which is then used to select
the referenced items.
/cgi-bin/man2html.cgi?1+^ls
lists all manual pages from section 1 which descrip-
tion line start with ``ls''.
EXAMPLES
The following two example invocations
man ls | man2html >ls.html
man ls | man2html - >ls.html
produce HTML files with links to other static HTML files
for every reference found in the manpage.
man ls | man2html - -
doesn't link anything.
man ls | man2html - rm.1
links every occurence of a reference to rm(1) to the file
rm-1.html.
SEE ALSO
mancc(1).
16 May 1999 MAN2HTML(1)