manbook – produces an eBook from man pages

SYNOPSIS

manbook <MANPAGE>
manbook <MANPAGE1> [<MANPAGE2> ...]
manbook <MANPAGE> --output <DIRECTORY>
manbook <MANPAGE1> [<MANPAGE2> ...] --output <DIRECTORY>
manbook --all --output <DIRECTORY>

mktoc <DIRECTORY>

DESCRIPTION

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.

QUICKSTART

gem install manbook
manbook --help
mktoc --help

MANPAGE

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.

OPTIONS

You can specify an individual man page or a list of man pages using a few options.

See manbook --help to view the options at any time.

INSTALL

gem install manbook

EXAMPLES

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/

EXIT STATUS

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.

HISTORY

After I bought a Kindle, the idea was born to put the man pages of my Mac onto my Kindle. My requirements are:

  1. Input should be exactly the man pages on /my/ system, not someone else's FreeBSD or whathever

  2. Should respect my MANPATH (not just look in /usr/share/man)

  3. Pages should be as plain-text as possible (no PDF).

  4. eBook should provide an index with a list of all man pages by section and by name

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.

BUGS

Requires the groff script to be in your path and executable.

Requires Ruby and RubyGems.

Please report other bugs at github.com/nerab/manbook/issues

CONTRIBUTING

manbook is Copyright (C) 2011 Nicolas E. Rabenau. See LICENSE.txt for further details.

SEE ALSO

groff(1), en.wikipedia.org/wiki/Man_page, mail2kindle