1man2html(1)                 General Commands Manual                man2html(1)
2
3
4

NAME

6       man2html - format a manual page in html
7

SYNOPSIS

9       man2html [options] [file]
10

DESCRIPTION

12       man2html  converts a manual page as found in file (or stdin, in case no
13       file argument, or the argument "-", is given) from man-style nroff into
14       html,  and  prints  the result on stdout.  It does support tbl but does
15       not know about eqn.  The exit status is 0. If something goes wrong,  an
16       error page is printed on stdout.
17
18       This can be used as a stand-alone utility, but is mainly intended as an
19       auxiliary, to enable users to browse  their  man  pages  using  a  html
20       browser like lynx(1), xmosaic(1) or netscape(1).
21
22       The  main  part  of  man2html  is  the  troff-to-html engine written by
23       Richard Verhoeven (rcb5@win.tue.nl).  It adds hyperlinks for  the  fol‐
24       lowing constructs:
25
26       foo(3x)           "http://localhost/man/man2html?3x+foo"
27       method://string   "method://string"
28       www.host.name     "http://www.host.name"
29       ftp.host.name     "ftp://ftp.host.name"
30       name@host         "mailto:name@host"
31       <string.h>        "file:/usr/include/string.h"
32
33       (The first of these can be tuned by options - see below.)  No lookup is
34       done - the links generated need not exist.  Also an index with internal
35       hyperlinks  to  the various sections is generated, so that it is easier
36       to find one's way in large man pages like bash(1).
37
38

OPTIONS

40       When reading from stdin, it is not always clear how to  do  .so  expan‐
41       sion. The -D option allows a script to define the working directory.
42
43       -D pathname
44              Strip  the last two parts from the pathname, and do a chdir(dir)
45              before starting the conversion.
46
47       The -E option allows the easy generation of error messages from  a  cgi
48       script.
49
50       -E string
51              Output an error page containing the given error message.
52
53       The general form of a hyperlink generated for a man page reference is
54
55              <method:cgipath><man2htmlpath><separator><manpage>
56
57       with  a  default  as  shown  above. The parts of this hyperlink are set
58       using the various options.
59
60       -h     Set method:cgipath to http://localhost.
61
62       -H host[.domain][:port]
63              Set method:cgipath to http://host.domain:port.
64
65       -l     Set method:cgipath to lynxcgi:/usr/lib/man2html.
66
67       -L dir Set method:cgipath to lynxcgi:dir.
68
69       -M man2htmlpath
70              Set the man2htmlpath to use. The default is /man/man2html.
71
72       -p     Set separator to '/'.
73
74       -q     Set separator to '?'. This is the default.
75
76       -r     Use relative html paths, instead of cgi-bin paths.
77
78       On a machine without running httpd, one can use lynx to browse the  man
79       pages,  using  the  lynxcgi  method.  When some http daemon is running,
80       lynx, or any other browser, can be used to browse the man pages,  using
81       the  http method.  The option -l (for `lynxcgi') selects the former be‐
82       haviour.  With it, the default cgipath is /usr/lib/man2html.
83
84       In general, a cgi script can be called by
85
86              <path_to_script>/<more_path>?<query>
87
88       and the environment variables PATH_INFO and QUERY_STRING will be set to
89       <more_path>  and  <query>, respectively.  Since lynxcgi does not handle
90       the PATH_INFO part, we generate hyperlinks with `?' as a  separator  by
91       default.   The option -p (for `path') selects '/' as a separator, while
92       the option -q (for `query') selects '?' as a separator.
93
94       The option -H host will specify the host to use (instead of localhost).
95       A cgi script could use
96
97              man2html -H $SERVER_NAME
98
99       if  the  variable SERVER_NAME is set.  This would allow your machine to
100       act as a server and export man pages.
101
102

BUGS

104       There are many heuristics.  The output will not always be perfect.  The
105       lynxcgi  method  will not work if lynx is not configured for it.  There
106       may be problems with security.
107
108

AUTHOR

110       Richard Verhoeven was the original author of man2html.  Michael  Hamil‐
111       ton   and  Andries  Brouwer  subsequently  improved  on  it.   Federico
112       Lucifredi <flucifredi@acm.org> is the current maintainer.
113
114

SEE ALSO

116       lynx(1), man(1), hman(1)
117
118
119
120                                1 January 1998                     man2html(1)
Impressum