Read man pages in your browser
Jul 07, '03 09:15:00AM
Contributed by: seb2
A friend of mine showed me a nifty small utility called manServer which lets you read man pages in a browser. Besides the fact that that it is more pleasant to the eye, it also generates hyperlinks (Description, Options, See also, ...) on the fly, and makes reading and navigating man pages a real joy.
The file can be downloaded in the "See also" section of the above-linked web page. Should Safari append an ".html" to the file name during download, better remove it to prevent the local webserver from serving the page as html. I even just renamed the file simply to "man" here for less typing later.
Here's what you have to do to get it to work:
- Open the file in a text editor and find the line that reads $ENV{'PATH'} = "/bin:/usr/bin"; and add another line below that reads:
$ENV{'MANPATH'} = "/usr/share/man:/usr/local/man:
/usr/local/share/man:/usr/X11R6/man";
You might want to add additional man paths according to your needs (the line has been broken into two for narrower display; enter it as one long line with no additional spaces).
- Put the file into /Library/WebServer/CGI-Executables
- Make sure it's executable (chmod 755 manServer).
- Start your local Apache via the Terminal or using Personal Web Sharing in the Sharing preferences panel
You can now access all local man pages by going to http://127.0.0.1/cgi-bin/man -- That is, if you named the downloaded file just "man" as I did. Otherwise, use whatever file name the file has in your cgi-bin.
[robg adds: I tested this app out and it works as expected, and is actually very useful -- the hyperlinks are a nice benefit. I had to control-click on the download and select "Save to disk" to prevent Safari from opening it in the browser, but after that, installation was as described, including the renaming step.]
Comments (16)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20030630060922242