Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Which .conf file do I need to edit in order to view man pages in a web browser? I'd like to use Google Chrome to do this.

Is this possible?

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

One way to do this is to put the following command in ~/.profile:

export PAGER="col -b  | open -a /Applications/Safari.app -f"

The PAGER environmental variable controls what program man uses to display man pages. the col command removes all of the backspace-formatting from the man page. The open command saves the output as a temporary text file and opens it with Safari.app.

Or you can edit the PAGER variable in /private/etc/man.conf. You could also probably edit the NROFF variable and eliminate the need to use col -b. See the man page for man.conf.

share|improve this answer
    
Thanks Nathan. That does the trick perfectly. I've just altered the line to read: export PAGER="col -b | open -a /Applications/Google\ Chrome.app -f" so it'll open in Chrome instead of Safari. –  boehj May 21 '11 at 0:35
1  
I'd been wanting to do this for myself anyway, and I'm glad I finally found time to look into it. I used TextWrangler with the command /usr/bin/edit --view-top --clean -t "Man page" –  Nathan Grigg May 21 '11 at 1:13
add comment

http://www.bruji.com/bwana/ is exactly what you're looking for.

share|improve this answer
    
Cheers. That does look interesting, esp. "We just threw in some color, some bold headers and cleaned it up a bit, so they go easy on the eye." I wonder if I can get such functionality from further editing a .conf file? –  boehj May 21 '11 at 2:12
add comment

You can add a function to your ~/.profile:

function gman {
     man "$1" | col -b > "/tmp/$1"
     open -a "/Applications/Google Chrome.app" "/tmp/$1"
}
share|improve this answer
    
This function wasn't working for me Graham. Not sure why. –  boehj May 21 '11 at 0:39
    
Is Google Chrome in /Applications/ or somewhere else? –  Graham May 21 '11 at 3:51
    
It's in /Applications/. –  boehj May 21 '11 at 8:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.