View Single Post
Old 06-21-2011, 08:12 AM   #1
Gnungnu
Junior Member
Gnungnu began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2011
Device: Kindle
Removing navigation bars from converted CHM

First of all I looked at the sticky on using the search/replace in Calibre. If that's the only way to do what I want to do, that's fine. I'll have to brush up on my regular expressions.

The approach I've been trying so far is a bit different though. I converted the CHM file to HTMLZ, unpacked it and ran a Python script I wrote to remove the navigation controls from the HTML, then packed it back up again, loaded the HTMLZ into Calibre, and tried to convert it to MOBI. I get an error that ends with:

File "site-packages\calibre\ebooks\oeb\reader.py", line 300, in _spine_from_opf
calibre.ebooks.oeb.base.OEBError: Spine is empty

I've tried doing this two ways so far. First I removed the table that was holding the navigation controls. That's everything between and including <table>...</table>. When that didn't work I tried removing the row from the enclosing table that held the table with the navigation controls. I got the same error both times. As far as I know the deletions were clean, leaving valid HTML behind. So at this point I can only presume that some elements of the HTML structure are fixed and necessary for the document to scan properly.

Am I removing too much? Too little? There seems to be some non-obvious meta structure to the HTML that is required for it to scan properly. Any guidance would be helpful. Thanks.
Gnungnu is offline   Reply With Quote