Produces an eBook from man pages
manbook <MANPAGE>
manbook <MANPAGE1> [<MANPAGE2> ...]
manbook <MANPAGE> --output <DIRECTORY>
manbook <MANPAGE1> [<MANPAGE2> ...] --output <DIRECTORY>
manbook --all --output <DIRECTORY>
mktoc <DIRECTORY>
The manbook
command can be used to produce an eBook from one or more
man pages.
mktoc
produces table-of-content files, suitable for MOBI files (Kindle,
etc) from the HTML files in a directory.
gem install manbook
manbook --help
mktoc --help
manbook
expects to be passed the name of one or more man pages. It will
use the MANPATH environment variable to find the man page and convert it to
HTML.
If more than one man page was passed, an additional index page will be
created. If the man pages are from different sections, manbook
will create
separate indexes by section together with an index file for each section.
You can specify an individual man page or a list of man pages using a few
options.
-o
, --output
:
Specifies the output file (when operating on a single man page) or
the output directory (when operating on multiple man pages) where
the HTML files will be written to.
-a
, --all
:
Produce a book with all man pages found.
See manbook --help
to view the options at any time.
gem install manbook
manbook ls
manbook ls grep bash --output ./my-favorite-pages/
manbook -a -o ./manpages/
mktoc ./my-favorite-pages/
mktoc --title "Kindle and the Fourty Amazons" ./my-favorite-pages/
The manbook
command returns with exit code other than 0 (zero) if one or more man pages could not be found or converted. If all goes well, the exit code will be 0.
After I bought a Kindle, the idea was born to put the man pages of my Mac onto my Kindle. My requirements are:
When I looked around for an existing solution, all I found was:
and a few other, not-quite-complete scripts. None of them satisfied my requirements, so I decided to write my own tool. Thus, manbook
was born.
Requires the groff
script to be in your path and executable.
Requires Ruby and RubyGems.
Please report other bugs at http://github.com/nerab/manbook/issues
manbook is Copyright © 2011 Nicolas E. Rabenau. See LICENSE.txt for further details.
groff(1), http://en.wikipedia.org/wiki/Man_page, mail2kindle