Thursday, May 14, 2020

genGUI

Written: 4/25/2017. My friend and fellow blogger CyberDave published a post in April titled Kindle-gen. So I looked through my Drafts folder and found my own ebook-related post. And I published it. Not that anyone is going to make heads or tails of either post, but if CD can publish ebook gibberish, so can I. Witnesseth:

I have an unrealistic expectation that I’m good at many things, even though my entire life stands in stark contrast to that notion. In my most introspective moments I wonder if I’m good at anything. But that’s a whole other topic.

So, being good at many things, I decided to write a book. Specifically, an ebook—an electronic book that you can read on your ebook reader (Kindle, Nook, Fire, iPhone, Android phone, Mac, or PC). Self-publishing an ebook is almost trivial. Step one: write an ebook. Step two: create an account with an online publisher. Step three: upload the ebook to the publisher’s website (Amazon, Barnes & Noble, etc.). You decide what the book will cost. The publisher takes a percentage of your ebook sales. This lets you bypass the gatekeepers—agents, print publishers and, unfortunately for some writers, copy editors—and your book goes straight to the public.

I said self-publishing was easy. Creating your own ebook is another matter. You have to be one half creative artist and one half software egghead. At least, that’s how it seems to me. Example: one day recently I spent the better part of the day writing a computer program to serve as a GUI front-end to Amazon’s Kindlegen command-line tool that converts opf or epub or html or zip files into Amazon’s proprietary mobi format. And just an hour ago I found myself pondering the difference between “huffdic” compression versus standard doc compression. If Aldous Huxley were alive, he would certainly be thinking that it’s a brave new world. Indeed, writing has come a long way from the Woodstock typewriter I used in my youth.

Ebooks begin life as HTML (Hyper-Text Markup Language), the language of the Web. But how does one write in HTML? There are HTML editors, of course. They’ve been around for a while and are much used for website design. Some document editors allow a file to be saved in multiple formats including HTML. You can write your own HTML using Notepad, which is how I designed websites back when the internet was new and there weren’t many tools to help website designers.

Nowadays, many ebook writers use a program designed with ebook production in mind, like Scrivener or Jutoh. But those tools only take you so far. To get from HTML to EPUB or Amazon’s MOBI format, you need a tool that converts your HTML into the ebook format.

Converting HTML to EPUB format isn’t difficult; there are even online converters for that format. But to convert HTML into the Amazon Kindle proprietary MOBI format, you must use Amazon’s Kindlegen, a command-line application. Some book editors—such as Scrivener—integrate with Kindlegen so that the conversion process is seamless.

Kindlegen is a command line program, which means it runs in a command box, a.k.a. “DOS box.” Kindlegen has several arguments that can be included with the file you’re converting. I’m not a fan of command line programs: they’re awkward to use and every time I use one I have to study what the various arguments do all over again. So I decided to write a GUI (graphical user interface) for Kindlegen. I call it “genGUI.”

It looks like this (click for larger image):


The empty rectangle on the right is the “output window” where Kindlegen’s messages appear in the language you have selected. The program works fine. I might use it one day to create a Kindle ebook. But the book I was thinking of publishing had a lot of images, and images make an ebook larger (file size), and file size is money. The project became uneconomical for what I had in mind. So I put it on the back burner for now. One day, one day, maybe.

No comments: