I've just completed a programming language book. Formatted 8-1/2 x 11 in Open Office it's 400+ pages. I tried to output it in html and it's awful. Way too much white space surrounding everything and lots of pre lines are broken. I tried hand editing it but gave up. Too much rubbish to deal with. I exported the doc as .txt .
I've decide to hand code a new xhtml version complete with custom css. I've read conflicting things on tables. I use two column tables with a code line number on the left and a technical description of what that line of code does on the right. Works fine, but is it legit on a kindle?
I also need to include a zip of source code with the book for the user to upload on to his/her computer. How is that handled? Is it even possible?
Candidly, I can't see anyone using a kindle to read this type of technical book. I use color, and limit code lines to 120 characters in a mono font. I'm expecting purchasers to use an ereader on a computer to read and test all on one platform.
Comments? I don't own a Kindle or any other hardware based ereader device, so I have no first hand experience with them.
First let me say that I'm glad you've have the good sense to see that most people wouldn't buy this in e-book form unless they owned a larger device like an iPad or Kindle DX. On the other hand, it costs you only your time to try it. But obviously a print book is going to sell better with something like this.
Before you give up and go to a .txt file and lose all your formatting, try downloading Calibre (it's free). Bring your .odt file into it and save it as a .rtf file. Then open the .rtf file along with your html editor and copy & paste the entire .rtf document into the editor. (That usually works better than importing it.) This produces a halfway clean file (much cleaner than trying to save .rtf from OpenOffice). You'll have to go through and delete some formatting at the beginning of each paragraph. It's mostly just font and text alignment code. You can do a “search & replace,” replacing the code with blank space very quickly. If you already have tables set-up in Word, I doubt they will transfer, so you may have to redo those. But this way gives you some pretty clean html really fast with all your italics, bolding, underlines, quotes, and whatnot right where they should be. (Exporting HTML from Word or OO generates some really bad HTML and likes to place things like italics outside of paragraph tags instead of within them where they ought to be.)
As to the zip folders, you can hyperlink to them on the web somewhere, but that's about it. Besides, it's not like readers could (or would want to) open a zip folder on their e-reader anyway. It's not a computer, so it would be pointless.
I've read programming books on a Kindle. Primarily using Kindle for PC, as that makes the most sense given the standard use case for such books, but also on an eInk Kindle device. They're certainly readable when formatted properly in either scenario.
Depending on how much information you're trying to fit into the table they may or may not work well for you. Tables have definitely improved with Kindle Format 8, but they're still not perfect and it's far too early to disregard Mobi7 entirely.
Do some tests and preview them using all of the device modes of Kindle Previewer before you go to the trouble of formatting your whole book. You may find that they work great, you may not. There are definitely other ways to present code line numbers and their descriptions if you find that the results are unsatisfactory.
Be sure to explicitly set left-alignment, in addition to the monospace font, for your code listings to prevent the automatic justification on Kindle.
This should be handled with a link to your website where the source files can be downloaded. Make sure that the full URL for this page isn't something that is likely to change, as it'd be pretty annoying for customers to purchase the book at some point in the future only to discover that there is no easy way to access the example source files. There is no way to bundle arbitrary external content with Kindle books.
Some of my tables cells are large to explain a particularly tough line of snippet of code. The small form factor of the ereaders isn't really appropriate for this type of book. I assumed folks would use a PC based reader.
I had heard that the kindle could be hooked to a PC and items transferred from it. I guess I just assumed there was a way to load the kindle up via an ebook format and then xfer files to the PC.
Thanks for the heads up that my assumption was bogus.
What do you think about putting the source code in as X number of hidden paragraphs and having one non hidden routine that the purchaser copies to his disk and it has the brains to extract the source code from the hidden p's? Would that pass Amazon's inspection/rules/criteria/whatever?
"I took the OO document and had Calibre convert it to epub."
NO! Make your mobi file first with KindleGen or Previewer. Then you can use Calibre to make an epub copy from that mobi. But don't ever use Calibre to make a mobi or epub file from anything other than an already existing mobi or epub.
I only suggested it as a means of getting rid of some bad formatting in your .doc files before pasting the content into your HTML editor. Actually, now that I think of it, OO producers halfway decent .rtf files too, so you might be able to skip Calibre altogether.
Also, when you've got your finished HTML, make sure it can pass the validator at W3C before trying to make a mobi from it:
"The only reason to not have it pure html is because Amazon wants it in their format. If there were a way of selling it as pure html that would be great."
The thing is, most people would like to have the code on a some kind of page they can access with their computer so they can just copy and paste it into their own HTML editor. You can't do that from an e-book. When people sell print books, they typically will also have some web pages that readers can go to and retrieve the same code that's in the print book. Or (and much better) they'll have a CD Rom attached to the inside flap of the book with all the codes on it. You obviously can't do the latter with an e-book. But you really need to think about having a website with the codes available somehow.