Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 01-07-2012, 03:16 PM   #1
UrbanR
Junior Member
UrbanR began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jan 2012
Device: kindle
XML Coding to Create Kindle book with Calibre

Hi,

for some time I have been trying to work out how to export an existing book, which has been published as a paper book, out of InDesign CS4 and into Kindle format.

There is a beta 'Kindle Export' plugin for InDesign, but I found its output was flawed. In my book at least, there are various annoying things like missing italics, etc.

My next move was to open the .mobi files it made in Calibre, and to 'inspect' at problematic points to see the xml. It looked like a mess ... there were loads of redundant font and css tags.

Next I tried using Indesign's built in 'Export to Digital Editions' which produces an epub file. There were also similar problems with that. So, I have resigned myself to having to do some manual editing of the xml.

I have exported the file from Calibre as HTMLZ, unzipped it and have it open in Dreamweaver. This is very useful for me as an ex-coder, as I can now see it is an unscary normal html file, which gives me hope that I will be able to iron out the teething problems.

However, there is a big problem: Calibre seems to have created thousands of redundant CSS tags. Almost every sentence has a new one, <div class="calibre4">, <p class="calibre27">, and so on...

My idea is that, if I could just get rid of all of these and make a simple file with simple html tags <p> <h1><h2> etc., then when it was converted back to a .mobi file it would work nicely...

Does anyone have any idea how to stop Calibre from creating all these tags, or why it does so? Or a quick way to strip them all out?

Alternatively, has anyone succeeded in exporting from InDesign successfully to epub or mobi ? I would appreciate advice from anyone who has done so.

and finally, there seems to be no straightforward guide to which standard tags you should use within a file destined for the Kindle (for the table of contents, headings, etc.). Is there one anywhere?

thanks,

Robin
UrbanR is offline   Reply With Quote
Old 01-07-2012, 03:36 PM   #2
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 65,452
Karma: 43770933
Join Date: Nov 2006
Location: UK
Device: Kindle Voyage, iPad Mini, iPhone 4, MS Surface Pro, N7
I would suggest that you export to ePub, edit your ePib file using Sigil and convert to Mobi when the ePub version is right.
HarryT is offline   Reply With Quote
 
Advertisement
Old 01-07-2012, 03:40 PM   #3
UrbanR
Junior Member
UrbanR began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jan 2012
Device: kindle
unfortunately I have downloaded Sigil and it crashes when I try to start it up! Will try again though, thanks
UrbanR is offline   Reply With Quote
Old 01-07-2012, 03:44 PM   #4
UrbanR
Junior Member
UrbanR began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jan 2012
Device: kindle
yeah, I have Mac os X 10.5.8, and Sigil only works on 10.6 or higher. Is it really that much more useful?
UrbanR is offline   Reply With Quote
Old 01-07-2012, 04:14 PM   #5
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 65,452
Karma: 43770933
Join Date: Nov 2006
Location: UK
Device: Kindle Voyage, iPad Mini, iPhone 4, MS Surface Pro, N7
It's an ePub editor. You can of course edit your ePub files in other ways, but Sigil is a pretty damned good tool.
HarryT is offline   Reply With Quote
Old 01-07-2012, 05:13 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,530
Karma: 43837842
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It really doesn't matter how many tags are assigned css classes (even if it's every single one) in the source that's going to be used for building a mobi. Because all the css gets converted to simple HTML 3.2 attributes in the mobi (all the attributes that are supported by mobi anyway).

Before you're convinced that it's necessary to strip all of those classes from your source epub, use mobiunpack.py to see what's inside a normal mobi... all the css classes and a css file would be far prettier than what's actually in there, I promise you.
DiapDealer is online now   Reply With Quote
Old 01-09-2012, 07:45 PM   #7
UrbanR
Junior Member
UrbanR began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jan 2012
Device: kindle
ok thanks, looks like it's time to upgrade my OS and give Sigil a try.
Nevertheless, it will be difficult to do any editing on this file with so many tags everywhere. I think this is what causes the problems with the italics, where there are hundreds of overlapping tags...
The file formats seem quite confusing...
I am also about to get Indesign CS5 which supposedly does a better job of exporting epubs than which CS4 I have at the moment. We'll see ...

Last edited by UrbanR; 01-09-2012 at 07:52 PM.
UrbanR is offline   Reply With Quote
Old 01-11-2012, 02:55 PM   #8
halfgone
Member
halfgone began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2009
Device: none
I use this guide for creating my ebooks using "normal" html tags.

hope this helps.

Edit**
The only issue I have with his supplied header file is that I have an extra large margin on the left side in my kindle. It isn't actually that large, but it's wider than the right margin. I'm not sure what coding I'm doing wrong to create that.

Last edited by halfgone; 01-11-2012 at 02:57 PM. Reason: additional info
halfgone is offline   Reply With Quote
Old 01-13-2012, 08:51 AM   #9
UrbanR
Junior Member
UrbanR began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jan 2012
Device: kindle
many thanks for that halfgone. I read the first page of the article and I absolutely agree with the approach! As both a book publisher and a coder, I'm not happy with not knowing exactly what is going on in the formatting tags...!
UrbanR is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simplest Way to Create a Kindle Book from Scratch? knitterlauri Workshop 2 12-30-2011 02:59 PM
Using Calibre to create Kindle format Tag for Go To Beginning cjallan Kindle Developer's Corner 0 08-31-2011 11:38 PM
Converting DocBook XML source book with calibre! baccilus Calibre 1 12-04-2010 01:32 AM
Creating XML book listing with Calibre JTAL604622 Library Management 5 06-01-2010 03:57 PM
Media.XML and how to create one from pc Student1 Sony Reader Dev Corner 4 05-06-2009 08:39 PM


All times are GMT -4. The time now is 08:56 PM.


MobileRead.com is a privately owned, operated and funded community.