View Single Post
Old 01-03-2010, 10:40 PM   #259
chorpler
Zealot
chorpler has a complete set of Star Wars action figures.chorpler has a complete set of Star Wars action figures.chorpler has a complete set of Star Wars action figures.
 
Posts: 128
Karma: 278
Join Date: Jun 2008
Device: Kindle; PRS-500; MobiPocket on Windows Mobile
OK, thanks to Kovid's help above, I was able to figure out why converting a book from OEB to Mobipocket strips out all of the <reference> links in the <guide> section of the OPF file except one Table of Contents link and a cover link. It turns out the OEB input contains a module named guide.py, in the directory:

src/calibre/ebooks/oeb/transform

which actually has the specific function of stripping everything but one cover and one TOC link out of the <guide> section of the input OPF file. Commenting out the last three lines of the guide.py file (and of course setting the CALIBRE_DEVELOP_FROM variable to the c:\calibre\src directory, if that's where the calibre source is) fixes the problem:

Code:
 
            #if x.lower() not in ('cover', 'titlepage', 'masthead', 'toc',
            #        'title-page', 'copyright-page', 'start'):
                #self.oeb.guide.remove(x)
I presume this must have some use -- apparently it was designed to choose which cover image to use, if there are multiple cover images specified? But it's having unintended consequences with Mobipocket output...

Last edited by chorpler; 01-03-2010 at 11:19 PM. Reason: Forgot you had to comment out the last THREE lines, not just the last line, or it complains about indentation and whatnot
chorpler is offline   Reply With Quote