[FM Discuss] Putting FLOSS Manuals in the Kindle Store

James Simmons nicestep at gmail.com
Sun May 15 17:14:47 PDT 2011


In about 24 hours my book "Make Your Own Sugar Activities!" will be
available for purchase in the Kindle store.  You'll also be able to
download the first few chapters for free.  I think that this is
something we should routinely do with finished FLOSS Manuals.  It is a
lot less work than putting a book on Lulu and the Kindle store has a
lot more visibility.  I'm not suggesting that we give up on Lulu, just
that we add the Kindle store to the ways you can get a FLOSS Manual.

Booki already does most of what you need to make a Kindle-formatted
book, and OBJAVI *could* be modified to do the rest.  Until then
you'll need to do some work by hand:

1).  Export the book as an EPUB.

2).  Run the kindlegen program (a free download for Windows, Linux,
and Mac OS) on your EPUB to create something that is readable on the
Kindle.  This will NOT meet Amazon's requirements for the Kindle
Store, because it lacks a Table of Contents and a cover image, but the
Kindle can use it.

3).  Using either the Kindle Previewer or a real Kindle look through
the book for formatting errors and go back to Booki to fix them.  I
found a problem with bullet points because I used Open Office to
create the first few chapters of my book, then I pasted the chapters
into TWiki.  This caused my <li> tags to have <p> tags nested within
them, a problem I would NOT have had if I had used TWiki (or Booki) to
write the chapters.  I was able to fix this in Booki by turning on
HTML mode in the editor and getting rid of the <p> tags.  In the
Kindle having the <p> tags in there makes the bullet appear on one
line and the text appear on the following line.

Note that the docs on Amazon's site say you can't use <table> tags in
your book.  That is wrong.  The current Kindles display tables just
fine.

Another thing you should do is add a section to your Introduction
explaining how to get the book in various formats, including the
website, Lulu, the Internet Archive, etc.  When people download the
free sample of your book they will get this information.  If you have
code samples in your book the Kindle will NOT render them well at all
so you should direct your readers to the website so they can see the
code properly formatted.

The Kindle Previewer is available for Windows and Mac OS, but not
Linux.  However, the Windows version runs under WINE.  It is too slow
under WINE to be used to check every page for formatting errors, but
it works well to verify that your cover image and Table of Contents
are correct.

4).  Create a cover image and upload it to your book.  The cover image
does not have to be linked to any page of your book, it just needs to
be uploaded.  You can use the "Insert Picture" button in the editor,
upload the image, then cancel out.  The image itself can be a white
rectangle with a 5 pixel grey border.  I used a 600 x 800 canvas, but
Amazon recommends something a bit larger.  You can easily create a
usable cover image in The GIMP.  I put an orange rectangle with
rounded corners at the bottom of the image which contains the same
text that we put on the back covers of printed FLOSS Manuals.  I also
put my name on the cover image as the author.  The printed book does
not have that.  Amazon wants books to have authors.  You can have
multiple contributors, including photographers, translators, etc.
They will all be listed on the Kindle Store page.

5).  Re-export your book as an EPUB.

6).  Create a directory and unzip your EPUB into it.

7).  Make a copy of the XHTML file for your first chapter named
something like ch000_table_of_contents.xhtml and use an HTML editor to
make a Table of Contents out of it.  The Seamonkey web browser from
Mozilla has a perfectly adequate HTML editor that you can use for
this.  Each chapter in the TOC must have a relative link to the
chapter XHTML file that contains it.

8).  Use the same HTML editor to edit your Introduction chapter and
put a centered <h1> entry with the title of your book at the top of
the chapter.  Underneath it put a centered paragraph with "by Author
Name".  I chose to put this text in italics.

9).  Using a text editor edit the content.opf file.  You'll need to
fix the top of the file to be like this:

  <metadata>
    <dc:publisher>FLOSS Manuals http://flossmanuals.net</dc:publisher>
    <dc:rights scheme="License">GPLv2+</dc:rights>
    <dc:language>en</dc:language>
    <dc:title>Make Your Own Sugar Activities!</dc:title>
    <dc:creator>James D. Simmons</dc:creator>
    <dc:date>2010-11-28</dc:date>
    <dc:date scheme="start">2010.12.09-07.20</dc:date>
    <dc:date scheme="last-modified">2011.05.13-00.00</dc:date>
    <dc:date scheme="published">2011.05.13-18.25</dc:date>
    <dc:identifier
id="primary_id">http://en.flossmanuals.net/epub/ActivitiesGuideSugar/2010.11.28-14.18.35</dc:identifier>
    <dc:identifier
scheme="booki.cc">http://booki.flossmanuals.net/make-your-own-sugar-activities/2011.05.13-18.25</dc:identifier>
    <meta name="cover" content="att000_MYOSA_Cover" />
  </metadata>
  <guide>
	<reference type="toc" title="Table Of Contents"
href="ch000_table_of_contents.xhtml" />
  </guide>

Note that I have changed the creator to be myself and I've added
entries pointing to the cover image and my new TOC page.  The TOC page
will need its own <item> like this:

    <item href="ch000_table_of_contents.xhtml"
media-type="application/xhtml+xml" id="ch000_table_of_contents"/>

The cover image should already have an <item> you can point to.

10).  Now you can zip up all these files and then change the suffix of
the zip file to .epub.  Interestingly, this is not an EPUB according
to the spec, because of the mimetype file.  According to Wikipedia:

"The mimetype file must be a text document in ASCII and must contain
the string application/epub+zip. It must also be uncompressed,
unencrypted, and the first file in the ZIP archive. The purpose of
this file is to provide a more reliable way for applications to
identify the mimetype of the file than just the .epub extension."

Our mimetype file says application/x-booki+zip and probably was not
stored uncompressed in the beginning of the file.  The nice thing is
that kindlegen doesn't care.  It DOES insist that you use a .epub
suffix for the file, though.  .zip will not be recognized as an EPUB
file by kindlegen.

11).  Run kindlegen against your new EPUB and you should have an
Amazon-compliant MOBI file ready for the Kindle store.  The file will
be larger than your original EPUB because it generates images for
several different kinds of Kindle outputs.  The MOBI that the customer
gets will be sized like your EPUB, more or less.  Use Kindle Previewer
or a real Kindle to check it out.  Also, pay attention to any messages
coming from the kindlegen utility.  If you didn't set up the cover
image or the TOC correctly kindlegen should tell you.

Sign up for Kindle Direct Publishing, upload your book and your cover
image, price the book at US .99, and in 24 hours or so the money
should start rolling in.  Soon you'll be eating lunch with the
Algonquin Round Table and living a life that Richard Castle might
envy.

James Simmons



More information about the Discuss mailing list