Quote:
Originally Posted by Tex2002ans
I'm wondering, what happens in the case of ALL CAPS chapter titles, but you have to Proper Title Caps in the TOC? You just go with the simple First Cap Every Word?
|
You shouldn't have to think about the case of the title at all; the whole point is the titles
have already been properly formatted in the existing toc and they are displayed differently in the html files, so regenerating the toc will require a lot of extra work; I just want to copy the text from the existing toc and past it back into the html files so I can regenerate the toc with the correct titles
which are already in the toc.
Edit for clarity: I mean, I want to copy the text
from the existing toc into a title attribute for each heading, without in any way relying on the text in the h* tags of each file.
So for example:
HTML file:
Code:
<h1 id="toc_marker-26">1</h1>
<h2><span class="Cap">E</span><span class="SmallCap">N CHEMIN POUR</span> <span class="Cap">S</span><span class="SmallCap">HADAR</span> <span class="Cap">L</span><span class="SmallCap">OGOTH</span></h2>
Corresponding title IN THE EXISTING TOC:
Code:
<navPoint id="navPoint-7" playOrder="7">
<navLabel>
<text>1. En chemin pour Shadar Logoth</text>
</navLabel>
<content src="Text/9782820516909-5.xhtml#toc_marker-26"/>
</navPoint>
The hypothetical plugin should copy the text from the toc: "1. En chemin pour Shadar Logoth" and stick it back in the html file at the point the link goes to, either by putting it directly into a title="" attribute inside the h* tag or, if that is too complicated as DiapDealer has suggested, by inserting it in an html comment <!-- 1. En chemin pour Shadar Logoth --> so that it can be regexed into place.
The final result (after the plugin and maybe a regex to place the text where it belongs) should be something like this:
HTML file:
Code:
<h1 id="toc_marker-26" title="1. En chemin pour Shadar Logoth">1</h1>
<h2><span class="Cap">E</span><span class="SmallCap">N CHEMIN POUR</span> <span class="Cap">S</span><span class="SmallCap">HADAR</span> <span class="Cap">L</span><span class="SmallCap">OGOTH</span></h2>
(I am ignoring for the reasons of this post the poorly constructed html code which should obviously also be fixed and which can easily be fixed with a simple regex).