View Single Post
Old 07-06-2020, 11:31 PM   #48
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Thanks for your spec. I have to again question why you want a plugin to do that if, as I've said before, you can do that quite easily and quickly just using your current NCX TOC as a reference(unchanged). Just mark all the headings in the relevant xhtml files with an h1 tag if you want them in your TOC. You can use the 'h*' button in Sigil to do that. You only have to mark about 8 main headings with h1 in the xhtml files, which shouldn't take you long. After that, using your current NCX file as a reference(unchanged), you can then just use Sigil's Generate TOC dialog to edit and re-build the TOC the way you want it. And all that is achieved without using any regex! The alternative for me is to create a one-off much-more-complex plugin that is only good for one person because it's so specific. That's also why I'm rapidly losing interest in the plugin now -- because, as I see it, a plugin isn't really necessary.

In my ebooks the epub TOC page and NCX TOC are usually always different. I normally build a complex, mutilevel TOC for my epub TOC page and then I build a simpler single level NCX TOC with headings like "Chapter 1 ~ This is my chapter 1 subtitle", "Chapter 2 ~ This is my chapter 2 subtitle" etc. So my NCX TOC also combines the chapter heading with chapter subtitle just like in your spec. And I do all that quickly and easily just using the Generate TOC dialog in Sigil. You should first create your epub TOC page using Generate TOC + Create TOC and then you can create a different NCX TOC just using Generate TOC again on its own. In the Generate TOC dialog, you can edit the headings and just type in and combine the Chapter heading name with the Chapter subtitle name, exclude any unwanted headings and then press the OK button and you will have a brand new NCX TOC that is formatted to your own preference.

Last edited by slowsmile; 07-07-2020 at 05:09 AM.
slowsmile is offline   Reply With Quote