man2html : Access Linux man pages via your browser
Lately I added a new section to this website : Linux man pages.
Linux command line programs generally come with their own documentation that we call man or man pages for manual pages.
In this post I take advantage of this opportunity to introduce man2html and how to install it.
man2html converts a manual page as found in file (or stdin, in case no
file argument, or the argument “-“, 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.
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 lynx(1), xmosaic(1) or netscape(1).
The main part of man2html is the troff-to-html engine written by
Richard Verhoeven (email@example.com).
The installation is quite simple, if you already have an Apache server, just use your package manager to install man2html, and access your man pages using :
for Debian based systems :
sudo apt-get install man2html
You should also install Swish-e (swish++). Well I found some problems regarding the installation and the configuration of this tool which is a search engine for man2html man pages. I made some search in the forums and maling lists, but I am still having the same problem :
Swish++ not installed
Search is only enabled if the Swish++ package is installed. You may download it from the Debian site.
I followed the instructions provided in the official website :
~ $ wget http://swish-e.org/<path to current swish-e version>.tar.gz ~ $ gzip -dc <path to current swish-e version>.tar.gz | tar xof - ~ $ cd swish-e-2.2 (this directory will depend on the version of Swish-e) ~/swish-e-2.2 $ ./configure ~/swish-e-2.2 $ make ~/swish-e-2.2 $ make test
First thing to say here, be sure that g++ and build-essential are installed. Second thing, the installation finished with success but the search engine was not functional !
I have tried other solutions and followed instructions from the debian bug tracker .. Nothing seems to be working.
My home-made solution was to install all packages having the prefix ‘swish’:
sudo apt-get install swish-*
This will install the following :
Note, selecting 'swish++' for regex 'swish-*' Note, selecting 'swish-e' for regex 'swish-*' Note, selecting 'libswish-api-common-perl' for regex 'swish-*' Note, selecting 'swish-e-dev' for regex 'swish-*'
It works !
Now you can use the full text internal search engine for Linux commands.
Happy hacking 🙂