Monday, May 24, 2010

iPhone retired in favor of my Motorola Milestone

I was thinking about this for a couple of weeks now. After a lot of people around me were joking about my two Smartphones I was carrying around all the time (iPhone 3G and Motorola Milestone). After nearly 2 years of use, I decided to retire my personal iPhone in favor of my Android based Milestone. The dicision wasn't easy, but I think that Android has a lot of potential and I want to spent more time with this OS.

This doesn't mean that I give up the iPhone completely: I still have my company iPhone. Only for the case that I really need that specific App, which is not yet available for my Milestone.

Saturday, May 1, 2010

Create ProGit epub from source

A couple a days ago, I discovered that the Book Pro Git (Expert's Voice in Software Development) is available in source form on GitHub. Browsing through the repository, I found out that there is a folder called "epub" which contains a groovy script to create an epub Version of this book. Wow, that is really great! Using groovy and some other tools to create the epub. I started to clone the repository to create my own epub version of the book.


The first run of the script didn't work well on my Mac. To be honest it failed because of the missing dependencies (markdown and the path to calibre). I didn't want to download markdown and install it for this one time use. I decided to have a look into the script and find a different solution.


The creation of the epub is basically running in three steps:
  1. Convert all Files from the given language directory and fix the links to the figures. Convert the files afterwards into HTML by using markdown. Write the file to the target directory
  2. Merge all files from the target directory into one big HTML file
  3. Call calibre's ebook-convert and create the epub out of it

I made some modifications to the original groovy script
  • Use of markdownj instead the perl markdown implementation. I'm using groovy's @Grab annotation here to download the library on the first run of the script.
  • Make use of groovy's great Regex support and do a one-line search and replace on the whole file content
  • Added a custom CSS for the epub, to improve the layout of lists in the epub
  • Reduced the overall LOC by removing unnecessary code
Now the solution looks like this (it's not perfect, but it works fine for me)

Running the script created now the epub that I can now read on my nook.

You can find the new version here.

One last thing to say: Even if this book has been made available freely by the Author and the Publisher, I recommend buying the printed version to support this kind of generosity. Let the epub Version of this great book be wonderful extra of the printed Book.