Quote:
Originally Posted by slowsmile
As I see it, there is really no need to create the TOC with the plugin because surely it's easier just to add a title attribute(with heading names) to each chapter heading which would then allow you to manually create another TOC in seconds using Generate TOC then Create TOC in Sigil.
|
Yes, absolutely. My question was about where the text of the title was being copied, eg from the toc or from the html file, sorry I was unclear.
Quote:
Originally Posted by slowsmile
No, my plugin does not assume a title attribute is already in the chapter headings. My plugin always creates and inserts new title attributes with chapter heading values into each chapter heading tag for each selected file. As well, it is also not necessary for the chapter heading to have an h1 tag -- it can have any tag you like -- since my plugin actually finds the chapter headings by choosing the first html line with text in it from the start of each file. As I've already mentioned, I've tried to design the plugin to accommodate and handle worst case file scenarios including files added to your epub that are a mess. So simply assuming that all your selected files will already be using an h1 tag seems a bit short sighted to me, especially if, as you say, you're dealing with either adhoc added files or you're dealing with added files that are complete trainwrecks where absolutely nothing is guaranteed and where nothing should really be expected or assumed.
|
Ok, good to know. I am not sure how often I will need this but I will try it out.
Quote:
Originally Posted by slowsmile
Thinking about it further in regard to you creating a new TOC, it would also seem sensible to change each discovered chapter heading tag to an h1 tag since, when I tested it, Sigil's Generate TOC does not seem to recognize or find chapter headings with a 'title' attribute value. But if you changed all the chapter heading tags to h1 they will be found when you open the Generate TOC dialog in Sigil.
|
I am not sure about this. If I have a book which has parts and then chapters, the chapters will not be in h1 tags, and if the correct h tags are already present and only the presentation of the title needs to be fixed (for instance, fake small caps, or all caps when I want lower case, or number + title with some added punctuation for the toc, or a toc entry different to what is displayed in the page...), I do not want the plugin to change them. This is actually somewhat outside the scope of what I am looking for.
Quote:
Originally Posted by slowsmile
And within Sigil's Generate TOC dialog you can re-type and change heading names, exclude headings and vary indents to your hearts content. In other words there's really no need for you to use regex or anything else to generate and create your new TOC -- you should be able to do it all easily and quickly using Sigil's Generate/Create TOC facility after running the new plugin below. Anyway, I've modified the original plugin to also rename the html tags of all selected chapter headings to h1 in the new version of the plugin(see below), which I think will be more useful to you.
|
Changing names in the dialog is very useful if you have only one or two small changes to make, but I don't want to have to re-do every single title that way. My goal is still to be able to preserve the EXISTING correctly presented titles from the existing toc, when they are different to the titles displayed in the html files. It is much more complicated to do this when your starting point for acquiring the text is the html file; modifications and changes will be necessary on a title-by-title basic, which could be avoided if it were possible to simply copy the correct text from the toc back into the html file.