Load Emacs Documentation on your Kindle

There is a lot of free content you can load onto your Kindle. It just a matter of converting to the right format for your Kindle. It is a great device for reading manuals. I’ve loaded my Kindle with all the Python documentation as well as the emacs documentation. Here I show how to load the emacs manual. You can use the same methods for others.

These steps can be done on the Windows and Macintosh platforms as well as Ubuntu. Here are the steps in detail for Ubuntu.

Configuration:

  • Kindle 2, Model D00511
  • Ubunutu 10.04 LTS

Download Emacs Single Page Document

Emacs provides a single page HTML file of all the documentation. Download this page to your machine.

cd ~/tmp

wget http://www.gnu.org/ software/ emacs/ manual/ html_mono/ emacs.html

You can see the file in the tmp folder.

ll -h
-rw-r–r– 1 steve steve 3.3M 2011-09-25 11:55 emacs.html

Note: Python documentation comes in a zip file of many HTML files. From all these files you can create an ebook for your Kindle. Just point the converter at the content.html file.

Install calibre

You use calibre to convert the html file to a book (mobi file). If you don’t have calibre, you can install it with:

sudo apt-get install calibre

Here is the current version:

ebook-convert –version
ebook-convert (calibre 0.8.20)
Created by: Kovid Goyal <kovid@kovidgoyal.net>

Note: There are many options you can specify when converting from html to mobi. The options are listed here:
http://manual.calibre-ebook.com/cli/ebook-convert-3.html#html-input-to-mobi-output

Convert HTML to Mobi

If you use the defaults for conversion, the index at the beginning of the book is one big table that runs for many pages. You cannot select any of the links so it is pretty useless. To fix this, specify linearize-tables option and the table will be converted to regular text.

Convert the emacs.html file into a mobi file and turn the tables into regular text. It takes a few minutes to convert:

ebook-convert emacs.html emacs.mobi –linearize-tables –title “The Emacs Editor” –authors gnu.org –comments “The Emacs Editor Kindle book generated from gnu.org single page HTML file.”
 

You can see the file created:

ll -h
total 4.8M
-rw-r–r– 1 steve steve 3.3M 2011-09-25 11:55 emacs.html
-rw-r–r– 1 steve steve 1.5M 2011-09-25 13:20 emacs.mobi

Copy to Kindle

Copy the book to your Kindle. Plug it into the USB port then:

cp emacs.mobi /media/Kindle/documents/
eject Kindle

The content page generated by calibre is at the end of the document. The book is called “The Emacs Editor”

Now you can store the manual under your pillow.