@Mister L...I've now discovered why no-one will be able to create the plugin you want from your spec. I continued working on the plugin, which is actually working now, more or less, according to your own spec(see below). But here is the point -- that plugin will only work for the epub that I used to test the plugin but it will never work for any other epub. Why? Well here's the problem with your spec:
Quote:
- Some html files have NO toc marker at all (eg the cover, titre.html...): in these files, the toc reference should be copied from the ncx into a new h1 tag OR an html comment at the top of the html file, whichever is easiest to code.
|
How can you expect the plugin to find those p tags if those p tags have no associated unique string or id? It can't be done, that's wishful thinking. So instead and as a challenge because I was so bored(it's a COVID thing) I hard coded the location of the p tags using either the file position or file names of the
cover.html, titre.html and
carte.html files. And it worked for the test epub. But unless you somehow add a helpful string or id to those p tags or perhaps even use a hidden h1 tag(using the
display:none class property) together with an appropriate heading string that can be easily equated and compared to its NCX equivalent then that plugin will never fly for any other epub other than your test epub.
I also found a lone non-breaking space lurking in between the empty h1 tags in the Citation file in your test epub which unhappily screwed up the results. How did that get there? I didn't bother to fix that, no point since no one's going to use the plugin anyway. By that time, as you'll appreciate, I'd had enough.