Friday, May 26, 2006

Firefox and Manpages

I prefer to read manpages in a web browser rather than in a terminal or a text editor. Konqueror formats manpages very nicely [screenshots here], but I use Firefox, and do not use KDE.

I wish there were a Firefox extension to handle manpages in a similar way to Konqueror. Instead, I use man2html. I setup a Smart Keyword so that typing man firefox for example retrieves the manpage for Firefox.

Unfortunately I feel its output is not as pleasing as Konqueror's. As a stopgap measure, I use the Greasemonkey Firefox extension to add some CSS to make the pages more to my liking.

  • script.js: Greasemonkey script that activates every time man2html is invoked on localhost. Adds a CSS file to the page.
  • man2html.css: CSS file that changes the look of the manpages.


Alan Clements said...

Found your post while looking for data on man2html. While your system works it would seem easier to just add a print statement to include the line the man2html source file.

odomok said...

print works, but it would be annoying to repatch the source at every update, or maintain a forked package (.deb?) file..

I managed another way. In Apache:

Header set LINK "; REL=stylesheet;"

With your CSS file it looks really nice.

There is a downside, that it does not work with all browsers. Tested: [firefox->working] [chromium->not working]

odomok said...

That would be:
<LocationMatch "/cgi-bin/man/man2html*">
     Header set LINK "</man2html.css>; REL=stylesheet;"