Creating an eBook like The Dog We Stole

Anju published The Dog We Stole (Amazon ebook link) as a series of blog posts on her blog. And we planned to convert it into an eBook if it did well. The blog posts were quite popular, and the overall feedback was very positive. Hence I started creating the eBook. This is not my first eBook creation. I have created three editions so of BollySwar, which are available on Kindle and other stores. I used a lot of scripts to create the BollySwar; very few chapters were manually edited. In the current series, I did create most of the pages manually.

As usual, EPUB is my preferred format to create eBooks. It's an open format and easy to create as it's based on web formats. I didn't edit HTMLs manually but used an editor called Sigil Ebook Editor. It's multi-platform and easy to use if you know HTML.

My only problem with Sigil is that it edits the .epub files directly, a zip file. On file system, it stores and edits .epub file like an opaque binary file. This makes it difficult to track the changes in a git repo. Ideally, I would want Sigil to have two phases - EDIT and BUILD. During the EDIT, keep the files on the disk as though EPUB was extracted. So I can track the changes to individual HTML files, Style sheets, etc., in a GIT repository. That way, I can easily revert parts of it if required. In the BUILD phase, combine these HTMLs, Style Sheets, Fonts etc., into an EPUB file. Ready to be read by an eBook reader.

Sigil eBook Editor

In fact, for MySwar that is what I do. I have a script that creates HTMLs and Styles. All of it is tracked in a GIT repository. When everything is ready, I have another script that ZIPs it up into a .epub file. You can look at this python epub.py script to see how easy it is to build an EPUB book by just using HTML and CSS. So if you already have data/content in some structured way and want to build an eBook. I would say go scripting way; that way, it's easy to update in the future. Also, you can have your CI/CD pipeline for releasing the book.

My flow usually is

My eBook creation process

I use EPUBCheck for EPUB validation. It's part of my CI/CD. You can get that from here. The error messages from it are mostly friendly. Sometimes they can be cryptic.

I used Amazon's KindleGen to convert to MOBI format when required. It's a simple CLI; you can use it as part of your build/release process if required.

1 Response

  1. January 1, 2022

    […] Anju wrote a biography of Pathu. If you like pets, you might like the book. I helped in creating the ebook. Love SIigil. […]