View Single Post
Old 09-12-2011, 01:58 PM   #160
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,638
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi,

Thanks for posting! I grabbed it and tried it on a bunch of mobis I had and unfortunately, the internal links anchors from many of the internal links in the document no longer work. I tested it with mobiunpack version 31 without your changes and all internal links worked.

So somehow your changes have broken some of the internal links.
I will try to track this down.

I did get some form of NCX file but it was incomplete and there were error messages:

Write html
ERROR: last byte not 0x80
ERROR: text not found 1354424
Wite ncx
Write opf

I will keep playing with it to see if I get get the internal links working again.

Thanks for getting this ncx stuff going!

KevinH



Quote:
Originally Posted by fandrieu View Post
Thank you very much for all your quick replies !

I just downloaded v31 from the link you provided and finished retro-fitting the modifications I had made to v23.

I'll try to explain why / how I did those changes later but first, as code speaks louder than words, here's the file.

....

Just a few words:
* I just finished merging, it's not tested

* The NCX part is really a proof of concept, it does however produce an acceptable output on my test files with flat NCX.
It consists of:
- a code block with 3 methods just before unpackBook
- a main code block in unpackBook, enclosed by "#TEST NCX"
- a small mod to the OPF code, to add a ref to the NCX

* Other than there's some "empirical" changes I made while testing some files:
- FILEPOS_ON_ALL_ANCHORS: an option to use an alternate code that processes all empty anchors instead of focusing on existing links...
- replaced a " " by "\s+" in the "Insert hrefs into html" rx...
- alternate way to set the html file encoding

EDIT: sorry, the file i uploaded contained several fatal errors i failed to spot.
EDIT: the new file should work at least with calibre-generated mobis...
KevinH is online now   Reply With Quote