How to convert Linux man pages to HTML without using groff

conversionhtmlman

I would like to convert some Linux man pages to HTML without using groff. My prejudice against groff is due to some PNG rendering issues it is giving me that seems to be localized to Sabayon (as these issues do not seem to occur on my VirtualBox VMs for other distros). I realize this is a bug, but a solution seems to not be in the near future so I would like to ask if there are other ways to convert Linux man pages to HTML. Using the HTML pages at http://linux.die.net/man is not an acceptable solution as some of the man pages I am interested in are not there (e.g., emerge(1) is not there).

Best Answer

There are plenty of alternatives such as roffit, troff, man2html. There's also perl based online manpage browsers, such as manServer.

My favorite is pandoc, though sadly it doesn't seem to support ROFF input by default (though you can probably use it if you need to chain multiple transformation filters together.

man2html example:

zcat /usr/share/man/man1/dd.1.gz \ 
    | man2html \
    | sudo tee /var/www/html/dd.html

roffit example:

git clone git://github.com/bagder/roffit.git
cd roffit
zcat /usr/share/man/man1/dd.1.gz \
    | perl roffit \
    | sudo tee /var/www/html/dd-roffit.html

Other tools:

Related Question