As of yesterday, I am strongly considering adding Calibre to my already hacked up version of the git-scribe toolchain for producing ebooks. This seems like a good idea so that I can get "Book" support on the Kindle Fire. Calibre is able to add a Mobi header (cdetype=EBOK) that the Fire recognizes as a book rather than a "personal document".
A quick glance through the resulting book on the Fire, however, reveals a show-stopper for me: there are page breaks before every heading in the book. In Recipes with Backbone, this means that our 1-2 sentence introductions now appear on a nearly blank page. The mobi generated by git-scribe does not suffer from this problem, so it must be Calibre that is adding the page breaks.
I try reducing the page breaks from h1 and h2 tags on the command line:
ebook-convert book.mobi book_ebok.mobi --chapter-mark=none --page-breaks-before="//*[name()='h1']"but this seems to have no effect.
So I take a look at the various mobis in the Calibre display tool. For both the git-scribe and the Calibre versions of the document, the display in the viewer looks good:
Taking a look at the git-scribe DOM (by inspecting the element in Calibre's viewer), I see just the one manual page break (
By contrast, the Calibre DOM has manual page breaks before each sub-heading in the book:
It is pretty clear from the git-scribe DOM that the problem is all of the headings are h1 tags—even the sub-headings inside the chapters. Rather than dig through the toolchain to see where this is occurring (likely somewhere in asciidoc), I change the command line option to insert no page breaks:
ebook-convert book.mobi book_ebok.mobi --chapter-mark=none --page-breaks-before='/'With that, my DOM only retains the original manual page break before the chapter start and no in-chapter breaks:
Hopefully that does it for the Calibre clean-up. I will root through Recipes with Backbone a little more today. If all looks good, I will add a
post-mobi.shscript to my git-scribe tool chain tomorrow.