I found no easy way to make a decent-looking ePub, the standard ebook format, from my book (sadly) composed in OpenOffice.org Writer. Seeing an excuse to stop writing passive prose, to write living code, I sketched a script that makes an ePub from the HTML that Writer exports:
ebookmaker.py
Example: python ebookmaker.py mybook.html
This produces mybook-clean.xhtml -- clean simple HTML of your book that you can paste into your blog or wherever -- and a mybook.epub containing resized images.
The script starts with a table of options to personalize. Those options probably don't yet offer enough control to make the script work perfectly with other books, depending on how the formatting differs from mine, but if you know a little Python and regular expressions, you can adjust the rest.
Do you know a better tool? I tried a few other converters, such as Stanza, but the results were hideous.
Let me know if you use this. It wasn't much fun to write. ePub uses XHTML, which is XML, which, if you can imagine, is the kind of formal language that a herd of UN lawyers would design.
Now that I have my ePub version, do you know any popular sites to share it on?
Recent Comments