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/cgi-bin/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       -v or -V
54              Output page containing version information.
55
56       -f     Unused, kept for backward compatibility.
57
58       The general form of a hyperlink generated for a man page reference is
59
60              <method:cgipath><man2htmlpath><separator><manpage>
61
62       with  a  default  as  shown  above. The parts of this hyperlink are set
63       using the various options.
64
65       -h     Set method:cgipath to http://localhost. This is the default.
66
67       -H host[.domain][:port]
68              Set method:cgipath to http://host.domain:port.
69
70       -l     Set method:cgipath to lynxcgi:/home/httpd.
71
72       -L dir Set method:cgipath to lynxcgi:dir.
73
74       -M man2htmlpath
75              Set  the   man2htmlpath   to   use.   The   default   is   /cgi-
76              bin/man/man2html.
77
78       -p     Set separator to '/'.
79
80       -q     Set separator to '?'. This is the default.
81
82       -r     Use relative html paths, instead of cgi-bin paths.
83
84       On  a machine without running httpd, one can use lynx to browse the man
85       pages, using the lynxcgi method.  When some  http  daemon  is  running,
86       lynx,  or any other browser, can be used to browse the man pages, using
87       the http method.  The option -l (for `lynxcgi') selects the former  be‐
88       haviour.  With it, the default cgipath is /home/httpd.
89
90       In general, a cgi script can be called by
91
92              <path_to_script>/<more_path>?<query>
93
94       and the environment variables PATH_INFO and QUERY_STRING will be set to
95       <more_path> and <query>, respectively.  Since lynxcgi does  not  handle
96       the  PATH_INFO  part, we generate hyperlinks with `?' as a separator by
97       default.  The option -p (for `path') selects '/' as a separator,  while
98       the option -q (for `query') selects '?' as a separator.
99
100       The option -H host will specify the host to use (instead of localhost).
101       A cgi script could use
102
103              man2html -H $SERVER_NAME
104
105       if the variable SERVER_NAME is set.  This would allow your  machine  to
106       act as a server and export man pages.
107
108

BUGS

110       There are many heuristics.  The output will not always be perfect.  The
111       lynxcgi method will not work if lynx  was  compiled  without  selecting
112       support for it.  There may be problems with security.
113
114

AUTHOR

116       Richard  Verhoeven was the original author of man2html.  Michael Hamil‐
117       ton  and  Andries  Brouwer  subsequently  improved  on  it.    Federico
118       Lucifredi <flucifredi@acm.org> is the current maintainer.
119
120

SEE ALSO

122       lynx(1), man(1)
123
124
125
126                                1 January 1998                     man2html(1)
Impressum