Skip to content

Instantly share code, notes, and snippets.

@zmwangx
Created April 18, 2014 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zmwangx/11029552 to your computer and use it in GitHub Desktop.
Save zmwangx/11029552 to your computer and use it in GitHub Desktop.
Convert man pages to PDF or HTML.
# convert a manpage to PDF, and open in Preview
# (in fact, man -t generates PostScript, which is converted to PDF by Preview)
function pman {
man -t "${1}" | open -f -a /Applications/Preview.app
}
# convert a manpage to HTML and open in the browser
function bman {
tmpfile="/tmp/bman.$RANDOM.html"
man "${1}" | man2html > $tmpfile
open $tmpfile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment