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.
|