View Single Post
Old 01-16-2016, 07:50 AM   #5
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,625
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by Doitsu View Post
@roger64: Since your Python code seems to have something to do with footnotes, also check out my AddIDs plugin.
If you have the same number of footnote references and footnotes (and both are in the same order) you might be able to use it assign the proper ids to footnote references and footnotes. (You'd run it twice: once for the footnote references and once for the footnote definitions.)
This script goes just beyond this precise step. If the links are broken (if only the return links), I have used two regex like you to recreate the links (first the return ones with bad chapter numbers, then the body ones which point to the return file). As for the return links, the number of the body chapter is missing or wrong. This script finally retrieves the missing body chapter numbers and writes them on a new xhtml file.

If you are interested, I can PM you a test file using this script. It's quite efficient and quick but for this defect... It maybe could be integrated in your plugin.

I had first though I could have done a Calibre function out of this, but as no support seems to be available and I don't know how to proceed...
https://www.mobileread.com/forums/sho...41&postcount=1

Last edited by roger64; 01-16-2016 at 08:08 AM. Reason: function
roger64 is offline   Reply With Quote