Quote:
Originally Posted by 1v4n0
I tried, but I gave up (cit.). Here's the file. Can you do sthng w/ it?
|
I ran this Regex to pull the text outside of the links to take the text out of the link + compress it into a single line:
Search: <div class="sgc-toc-level-1">\s+
<a href="../Text/([^"]+)">([^<]+)</a>\s+</div>
Replace: <div class="sgc-toc-level-1">
\2<a href="../Text/\1"></a></div>
Example:
Code:
<div class="sgc-toc-level-1">
<a href="../Text/Section0004.xhtml">In principio era il gioco di parole</a>
</div>
to:
Code:
<div class="sgc-toc-level-1">In principio era il gioco di parole<a href="../Text/Section0004.xhtml"></a></div>
Then I copied/pasted all the HTML code into this and had it sort it (could have probably used any sorting site/tool):
http://alphabetizer.flap.tv/index.php
I pushed the Alphebatize button, it shoved them all in alphabetical order (according to name).
I then copied/pasted back into Sigil and ran this Regex to shove the text back into the link:
Search: <div class="sgc-toc-level-1">
([^<]+)<a href="../Text/([^"]+)"></a></div>
Replace: <div class="sgc-toc-level-1">
<a href="../Text/\2">\1</a></div>
Example:
Code:
<div class="sgc-toc-level-1">In principio era il gioco di parole<a href="../Text/Section0004.xhtml"></a></div>
to:
Code:
<div class="sgc-toc-level-1"><a href="../Text/Section0004.xhtml">In principio era il gioco di parole</a></div>
Attached = all alphabetized TOC.
Anyway, may I ask what the purpose of having it sorted in alphabetical order? It seems as if you have a bunch of duplicates, and it might make it very confusing to try to navigate a TOC that does not match the order of the book.