Introducing the Author Gem

I've been working on a ruby gem that makes authoring ebooks super simple. If simplicity is what you like, then you are in for a treat!

So, a few weeks ago I announced that I was going to start writing a book. Turns out, writing the content was the easy part. I naively thought "this is 2014, writing an ebook should be super simple!".

I could not have been more wrong.

I have literally gone through every option that is out there. I started with Leanpub because I have purchased a few books through them and I thought they would have mastered the process by now. Unfortunately, I didn't have a great experience.

Local development was a pain-in-the-ass. Every time I wanted to preview my book, I'd have to go to the website, find my book, click a button, wait a while, then open dropbox, then open the file, then AAAAAAAAAAAAAGGGGGGGGGHHHHHHHHHHHH!!!!!

It was a nightmare.

I looked at various ways of replicating what they were doing and eventually said "fuck that" and went in search of other tools. I found Kitabu and Wordsmith. They both have a similar approach to generating various ebook formats and while they came close, there were still things I was missing.

Finally, I threw in the towel and decided that if I wanted to get this book out, I was going to have to build my own tool. The first thing I did was to dive head first into the world of ebook formats.

Holy. Shit.

This is a terrifying place where nightmares don't even dare to go. The documentation is not at all where it needs to be. This article pretty much nails the current state of ebook documentation...AND IT WAS WRITTEN AT THE BEGINNING OF 2012!!!

Anyway, I finally pieced together enough of the puzzle to have a clear idea of what I had to do from the HTML side of things. Then, I went through the CSS3 Paged Media Module documentation on the W3 website. That's right. The working draft documentation *shudders*. That armed me with enough information to get the CSS out of the way.

All I had to do now was find tools that would allow me to convert an HTML - well, actually, an XHTML - site into various ebook formats. I searched high and low for the best solutions and ultimately landed on three different tools:

While KindleGen and eeepub are free, Prince XML is not. A single user license will run you around $500! Luckily, the free download is a fully functioning package. The only thing it does is add a small icon to the first page of the PDF.

Honestly, it's worth the $500 for the license if you plan on writing a lot of books. It is hands-down the easiest tool I experimented with.

Now that I had all the pieces, I just had to build a tool that brought everything together. And that, ladies and gents, is when Author was born.

The premise is super simple. Write your chapters in Markdown. Specify what order they should appear in using a plain 'ol text file. Then run a build command for the desired format and bam! So 'ello to your shiny new ebook.

I've decided to rely on Kramdown for the markdown processor. There are several reasons for that but the biggest is that it allows for a lot more formatting options. I'm also using Liquid to add in some extra functionality.

I've been using it for the last few days, and, so far, it has performed beyond what I even hoped for when I started building it. There are still a few things to work out but I'm very pleased with how simple it is to use.

If you're reading this and you decide to go try it out, I would love to get some feedback!

blog comments powered by Disqus