1man2html(1) General Commands Manual man2html(1)
2
3
4
6 man2html - format a manual page in html
7
9 man2html [options] [file]
10
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
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. This is the default.
61
62 -H host[.domain][:port]
63 Set method:cgipath to http://host.domain:port.
64
65 -l Set method:cgipath to lynxcgi:/home/httpd.
66
67 -L dir Set method:cgipath to lynxcgi:dir.
68
69 -M man2htmlpath
70 Set the man2htmlpath to use. The default is /cgi-
71 bin/man/man2html.
72
73 -p Set separator to '/'.
74
75 -q Set separator to '?'. This is the default.
76
77 -r Use relative html paths, instead of cgi-bin paths.
78
79 On a machine without running httpd, one can use lynx to browse the man
80 pages, using the lynxcgi method. When some http daemon is running,
81 lynx, or any other browser, can be used to browse the man pages, using
82 the http method. The option -l (for `lynxcgi') selects the former be‐
83 haviour. With it, the default cgipath is /home/httpd.
84
85 In general, a cgi script can be called by
86
87 <path_to_script>/<more_path>?<query>
88
89 and the environment variables PATH_INFO and QUERY_STRING will be set to
90 <more_path> and <query>, respectively. Since lynxcgi does not handle
91 the PATH_INFO part, we generate hyperlinks with `?' as a separator by
92 default. The option -p (for `path') selects '/' as a separator, while
93 the option -q (for `query') selects '?' as a separator.
94
95 The option -H host will specify the host to use (instead of localhost).
96 A cgi script could use
97
98 man2html -H $SERVER_NAME
99
100 if the variable SERVER_NAME is set. This would allow your machine to
101 act as a server and export man pages.
102
103
105 There are many heuristics. The output will not always be perfect. The
106 lynxcgi method will not work if lynx was compiled without selecting
107 support for it. There may be problems with security.
108
109
111 Richard Verhoeven was the original author of man2html. Michael Hamil‐
112 ton and Andries Brouwer subsequently improved on it. Federico
113 Lucifredi <flucifredi@acm.org> is the current maintainer.
114
115
117 lynx(1), man(1)
118
119
120
121 1 January 1998 man2html(1)