View Single Post
Old 06-01-2019, 07:23 AM   #2
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 195
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Calibre does not have what you are probably hoping for, but you can do the job fairly easily with regex. In fact, with the Kindle Paperwhite, once you have the footnote referenced in the text, you are mostly done.

You have:
Quote:
<a id="note-001"><sup>[1]</sup></a>
The simplest regex would be:
Quote:
Search: <a id="(.*?)"><sup>(.*?)</sup></a>
Replace: <a id="\1" href="notes.html#\1"><sup>\2</sup></a>
You're done, since the PW does not need a back link from the footnote page back to the text. If you want to code back links, the simplest method is to combine all your html text files into one (except the notes.html file) so one regex in the notes.html file will suffice. When you tell Calibre to then separate that big file back into component html files, Calibre will edit the links automatically to keep the links good. Done.

Last edited by Brett Merkey; 06-01-2019 at 07:43 AM.
Brett Merkey is offline   Reply With Quote