View Single Post
Old 11-05-2020, 11:38 PM   #1
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)
Renumbering notes

Hi

I have a book with over 900 notes. After OCR and tweaking with Sigil FootnoteLinker plugin, these notes are now numbered from 1 to 900 and links are OK.

However, the paper book lists notes by chapter. So, without touching the links, I need to change the note numbers, chapter by chapter.

Code:
<h3 id="toc1">first</h3>

  <p class="note"><aside class="ntb" epub:type="footnote" id="ftn1">
<span class="notesymbol"><a class="note" href="chapter10.xhtml#bodyftn1">1</a> text-one.</span>
  </aside></p>

  <p class="note"><aside class="ntb" epub:type="footnote" id="ftn2">
<span class="notesymbol"><a class="note" href="chapter10.xhtml#bodyftn2">2</a> text-two</span>
  </aside></p>

  <p class="note"><aside class="ntb" epub:type="footnote" id="ftn3">
<span class="notesymbol"><a class="note" href="chapter10.xhtml#bodyftn3">3</a> text-three</span>
  </aside></p>

.../...
  
  <h3 id="toc2">second</h3>

  <p class="note"><aside class="ntb" epub:type="footnote" id="ftn10">
<span class="notesymbol"><a class="note" href="chapter12.xhtml#bodyftn10">10</a> text-ten</span>
  </aside></p>

  <p class="note"><aside class="ntb" epub:type="footnote" id="ftn11">
<span class="notesymbol"><a class="note" href="chapter12.xhtml#bodyftn11">11</a> text-eleven</span>
  </aside></p>

  <p class="note"><aside class="ntb" epub:type="footnote" id="ftn12">
<span class="notesymbol"><a class="note" href="chapter12.xhtml#bodyftn12">12</a> text-twelve</span>
  </aside></p>
Here for example you can see three numbers I'd like to change by selecting the items under the second h3 title and performing .. something.

10 would become 1
11 would become 2
12 would become 3 and so on till the end of selected items.

Does somebody knows a way to do it?

I hope I have been clear...

Last edited by roger64; 11-06-2020 at 08:19 AM.
roger64 is offline   Reply With Quote