Quote:
Originally Posted by KevinH
Okay, I finally got some time and took a shot at creating TOCSaver_v010.zip.
This plugin should be used when a TOC is not based on headings (or the headings have incomplete text) and it should inject in the right headings and update title attributes so that if a user regenerates the TOC using Sigil tools it will come back quite close to the original NCX TOC. Effectively saving the current TOC into the xhtml files itself as needed.
If using an epub3, this plugin only parses the ncx and therefore you must use Sigil's epub3 Tools to generate an NCX from an existing Nav before launching the plugin.
This should be considered alpha level.
@Mister L, Please give it a try and let me know if this is what you wanted.
If and when it seems to work well enough, I will add it to its own thread and the plugin index.
Hope this helps.
KevinH
|
Brilliant!!!!! Thank you so much for this! I've tried it out quickly on 3 files and so far it seems to work perfectly. I will try to test it further soon and report back if necessary but I think it is already definitely ready to be added in the plugin index.
I tested it on files which had:
- files listed in the toc with no headings at all in the xhtml page
- files with titles split over 2 h* tags in the xhtml page
- files with headings that were significantly different in the ncx to the text in the page (eg spans to fake smallcaps in the xhtml page, and sentence case in the toc).
It handled all of these cases exactly as it should.
This is really going to make some projects a lot easier, thank you so much for tackling the job, I really appreciate it.

From some previous comments I think it will be useful for a lot of people.