man-pages/man1/man2html.1.html
2021-03-31 01:06:50 +01:00

239 lines
6.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of man2html</TITLE>
</HEAD><BODY>
<H1>man2html</H1>
Section: User Commands (1)<BR>Updated: 1 January 1998<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
man2html - format a manual page in html
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
man2html [options] [file]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>man2html</B>
converts a manual page as found in
<I>file</I>
(or stdin, in case no file argument, or the argument &quot;-&quot;, is given)
from man-style nroff into html, and prints the result on stdout.
It does support tbl but does not know about eqn.
The exit status is 0. If something goes wrong,
an error page is printed on stdout.
<P>
This can be used as a stand-alone utility, but is mainly intended
as an auxiliary, to enable users to browse their man pages using
a html browser like
<B><A HREF="/cgi-bin/man/man2html?1+lynx">lynx</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+xmosaic">xmosaic</A></B>(1)
or
<B><A HREF="/cgi-bin/man/man2html?1+netscape">netscape</A></B>(1).
<P>
The main part of
<B>man2html</B>
is the troff-to-html engine written by Richard Verhoeven (<A HREF="mailto:rcb5@win.tue.nl">rcb5@win.tue.nl</A>).
It adds hyperlinks for the following constructs:
<P>
<TABLE>
<TR VALIGN=top><TD><A HREF="/cgi-bin/man/man2html?3x+foo">foo</A>(3x)</TD><TD>&quot;<A HREF="http://localhost/cgi-bin/man/man2html?3x+foo">http://localhost/cgi-bin/man/man2html?3x+foo</A>&quot;<BR></TD></TR>
<TR VALIGN=top><TD><A HREF="method://string">method://string</A></TD><TD>&quot;<A HREF="method://string">method://string</A>&quot;<BR></TD></TR>
<TR VALIGN=top><TD><A HREF="http://www.host.name">www.host.name</A></TD><TD>&quot;<A HREF="http://www.host.name">http://www.host.name</A>&quot;<BR></TD></TR>
<TR VALIGN=top><TD><A HREF="ftp://ftp.host.name">ftp.host.name</A></TD><TD>&quot;<A HREF="ftp://ftp.host.name">ftp://ftp.host.name</A>&quot;<BR></TD></TR>
<TR VALIGN=top><TD><A HREF="mailto:name@host">name@host</A></TD><TD>&quot;mailto:<A HREF="mailto:name@host">name@host</A>&quot;<BR></TD></TR>
<TR VALIGN=top><TD>&lt;<A HREF="file:///usr/include/string.h">string.h</A>&gt;</TD><TD>&quot;file:/usr/include/string.h&quot;<BR></TD></TR>
</TABLE>
<P>
(The first of these can be tuned by options - see below.)
No lookup is done - the links generated need not exist.
Also an index with internal hyperlinks to the various sections
is generated, so that it is easier to find one's way
in large man pages like
<B><A HREF="/cgi-bin/man/man2html?1+bash">bash</A></B>(1).
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
When reading from stdin, it is not always clear how to
do .so expansion. The -D option allows a script to define
the working directory.
<P>
<DL COMPACT>
<DT id="1"><B>-D pathname</B>
<DD>
Strip the last two parts from the pathname, and do a
<I>chdir</I>(<I>dir</I>) before starting the conversion.
</DL>
<P>
The -E option allows the easy generation of error messages
from a cgi script.
<P>
<DL COMPACT>
<DT id="2"><B>-E string</B>
<DD>
Output an error page containing the given error message.
</DL>
<P>
The general form of a hyperlink generated for a man page reference is
<DL COMPACT>
<DT id="3"><DD>
&lt;method:cgipath&gt;&lt;man2htmlpath&gt;&lt;separator&gt;&lt;manpage&gt;
</DL>
<P>
with a default as shown above. The parts of this hyperlink
are set using the various options.
<DL COMPACT>
<DT id="4"><B>-h</B>
<DD>
Set method:cgipath to <A HREF="http://localhost.">http://localhost.</A>
<DT id="5"><B>-H</B><I> host[.domain][:port]</I>
<DD>
Set method:cgipath to
http://<I>host.domain:port</I>.
<DT id="6"><B>-l</B>
<DD>
Set method:cgipath to
lynxcgi:<I>/usr/lib</I>.
<DT id="7"><B>-L</B><I> dir</I>
<DD>
Set method:cgipath to
lynxcgi:<I>dir</I>.
<DT id="8"><B>-M</B><I> man2htmlpath</I>
<DD>
Set the man2htmlpath to use. The default is
<I>/cgi-bin/man/man2html</I>.
<DT id="9"><B>-p</B>
<DD>
Set separator to '/'.
<DT id="10"><B>-q</B>
<DD>
Set separator to '?'. This is the default.
<DT id="11"><B>-r</B>
<DD>
Use relative html paths, instead of cgi-bin paths.
</DL>
<P>
On a machine without running
<B>httpd</B>,
one can use
<B>lynx</B>
to browse the man pages, using the lynxcgi method.
When some http daemon is running, lynx, or any other browser,
can be used to browse the man pages, using the http method.
The option -l (for `lynxcgi') selects the former behaviour.
With it, the default cgipath is <I>/usr/lib</I>.
<P>
In general, a cgi script can be called by
<DL COMPACT>
<DT id="12"><DD>
&lt;path_to_script&gt;/&lt;more_path&gt;?&lt;query&gt;
</DL>
<P>
and the environment variables PATH_INFO and QUERY_STRING
will be set to &lt;more_path&gt; and &lt;query&gt;, respectively.
Since lynxcgi does not handle the PATH_INFO part, we generate
hyperlinks with `?' as a separator by default.
The option -p (for `path') selects '/' as a separator, while
the option -q (for `query') selects '?' as a separator.
<P>
The option -H <I>host</I> will specify the host to use
(instead of <I>localhost</I>). A cgi script could use
<DL COMPACT>
<DT id="13"><DD>
man2html -H $SERVER_NAME
</DL>
<P>
if the variable SERVER_NAME is set. This would allow your machine
to act as a server and export man pages.
<P>
<A NAME="lbAF">&nbsp;</A>
<H2>BUGS</H2>
There are many heuristics. The output will not always be perfect.
The lynxcgi method will not work if lynx was compiled without
selecting support for it. There may be problems with security.
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>AUTHOR</H2>
Richard Verhoeven was the original author of
<B>man2html</B>.
Michael Hamilton and Andries Brouwer subsequently improved on it.
Federico Lucifredi &lt;<A HREF="mailto:flucifredi@acm.org">flucifredi@acm.org</A>&gt; is the current maintainer.
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+lynx">lynx</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+man">man</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+hman">hman</A></B>(1)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="14"><A HREF="#lbAB">NAME</A><DD>
<DT id="15"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="16"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="17"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="18"><A HREF="#lbAF">BUGS</A><DD>
<DT id="19"><A HREF="#lbAG">AUTHOR</A><DD>
<DT id="20"><A HREF="#lbAH">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:19 GMT, March 31, 2021
</BODY>
</HTML>