I'm working with Dreamweaver, InDesign and BBEdit, so a solution that works with any of these programs would be great.
I'm converting a book that's in the public domain to an ebook. Each chapter has a series of superscript numbers that reference footnotes at the bottom of each page. I'm going to move all the footnotes to an appendix at the end of the book, then hyperlink the superscripts to the appropriate location.
Each chapter's footnotes begin with 1, 2, 3, etc. So I'll probably need to distinguish between chapters by linking to something like #1-1 and #2-1 for the first footnote in chapters 1 and 2, for example.
Anyway, I'd like to know if there's a way to automate the hyperlinking process. Some typical text would look like this:
<p>Some authorities reported greater casualties <sup>4</sup>, while at least one reported fewer <sup>5</sup>.</p>
After I finish linking to my footnotes, that text would probably look something like this:
<p>Some authorities reported greater casualties <sup><a href="#1-4" title="1-4">4</a></sup>, while at least one reported fewer <sup><a href="#1-5" title="1-5">5</a></sup>.</p>
I just wondered if anyone knows of a way to automate the linking process, using regular expressions, or one of the software programs I'm using. Each chapter is in a separate HTML file, and I can process one chapter at a time. I should also note that some footnotes are irregular, including letters (e.g. 14, 14a, 14b).