Thursday 26 January 2012

E Books and Hacking Code

The Eastender himself has been busy writing his latest pot boiler and decided that it shall be an E-book. Writing a physical book which is made from paper and ink is difficult enough, writing an ebook means, that if you don't have the required word processing software, then you have to make like a code monkey and insert some html into your document so that a table of contents will appear in it, when somebody downloads it to a kindle or similar device. A sample of the TOC code lies below:


<p><a name="TOC"><h3>Table of Contents</h3></a></p> 
<p><a href="#Chapter 1"><h4>Chapter 1</h4></a></p> 
<p><a href="#Chapter 2"><h4>Chapter 2</h4></a></p> 
<p><a href="#Chapter 3"><h4>Chapter 3</h4></a></p> 
<mbp:pagebreak/>
You also have to place an anchor at the chapter heading so that the hyperlinks work
<a name="Chapter 1">
<a name="Chapter 2">
<a name="Chapter 3">
etc....
This is not the end of it however, you also have to download the kindle development software (kindle previewer) so that you can verify that your book will look ok on the various devices that the book can be delivered to, to wit the kindle, kindle fire, kindle dx, kindle for i phone, kindle for ipad and kindle for pc. The save as html option on many wordprocessing packages leaves a lot of unnecessary code in the file and this can affect how the book looks on the various platforms, so I found it was better to upload the plain text and get the Amazon software to create the html and then check it on their simple viewer before downloading the file and checking it on the previewer to confirm that it looked ok on the various platforms it'll be ported to. Writing a book these days, means that you have to be part software engineer..... 

No comments:

Post a Comment