Convert man pages to HTML with the Ansi Html Adapter (aha)

11 Dec

I was having a hard time trying to find a man-to-html converter that does what I want: just properly translate the little formatting that man uses. What I found (groff, troff, roffit, man2html) seemed to be either outdated (using inline- or even html-styling) or buggy or simply unable to preserve man's formatting.

Thankfully I remembered aha, the Ansi Html Adapter.

This is what did it for me:

MAN_KEEP_FORMATTING=1 COLUMNS=90 man aha | \
ul | aha -s -b -t "aha man page" \
> /var/www/stuff/i3/aha.html

(instructions straight from aha's man page)

Then I removed the content of <style>...</style> and replaced it with this:

body {
       color: #bbb; 
       background-color: #111;
}
pre { font: 90% monaco, monospace; }
.underline   {color:#5a3;}
.bold        {color:#f33;}

And here you can see the result.

Next Post Previous Post