1

Sixteen years into the 21st century I remain baffled that we still have to go out of our way if we want to see a man page

  • rendered in a proportional font (that is, not Courier or similar)
  • with links to other referenced pages

There are tantalizing web sites with HTML man pages that have links, like this, but I haven't found such a site with pages updated for the current version of macOS. And of course a web site won't show man pages for software you've installed via Homebrew, etc.

Is there a solution to this problem? I've looked and looked. This

function manp {
  man -t "$1" | open -f -a /Applications/Preview.app/
}

renders a page and shows it in Preview (after you wait for a PostScript interpreter to convert it to PDF), but you don't get live links.

The man page for man says:

HTML PAGES

Man will find HTML pages if they live in directories named as expected to be ".html", thus a valid name for an HTML version of the ls(1) man page would be /usr/share/man/htmlman1/ls.1.html.

I could write a script to convert all of the man pages everywhere on my system to HTML, but I bet someone has already done this. And I bet they have also solved the problem of rendering SEE ALSO references as links, which the man command apparently doesn't do.

2

Install Bwana which allows you to browse the man pages in your favourite browser.

To quote the page above "Just type "man:" followed by the man page you're looking for into your browser's URL field. Hit enter and let Bwana do the rest." It has live links.

  • Unfortunately Bwana is apparently broken for macOS 10.12 and is not being maintained currently. Another version of bwana offers better formatting but has the same problems. – daveyost Dec 23 '16 at 2:15
  • I'm using it on macOS 10.12 and it works fine. Bwana version 2.7 – PeterVP Dec 23 '16 at 12:28
1

bcat lets you pipe stdout to your default browser. An alternative to your Preview function would be:

bman () 
{ 
    : Display man page in default browser
    man $* | col -b | bcat
}

...or simply set man's pager:

export MANPAGER='col -b | bcat'
man grep

bcat works with any command that writes to stdout:

pbpaste  | bcat
make test | bcat
tail -n 1000 -f /var/log/messages | bcat

...etc.

It's a ruby-gem, so installation is as easy as:

gem install bcat

If "on the fly" conversion isn't sufficient, and you want to produce HTML all at once, or in advance, this post on Unix.se has a number of suggestions (sadly one of my favourite tools, the mighty pandoc, won't work for this...)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .