![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
|
Suggestion: Better pattern for IDs in H elements
Sigil creates IDs in the Hn start tags automatically (e.g. with a merging).
Example sourcecode: <h2>preface (preface.xhtml) <h2>Chapter 1 (c01.xhtml) <h3>1.1 (c01.xhtml) <h3>1.2 (c01.xhtml) Result: <h2 id="sigil_toc_id_1"> (preface.xhtml) <h2 id="sigil_toc_id_2"> (c01.xhtml) <h3 id="sigil_toc_id_3"> (c01.xhtml) <h3 id="sigil_toc_id_4"> (c01.xhtml) I'm not in love with that pattern. My wish is: <h2 id="t-1"> <h2 id="t-2"> <h3 id="t-2-1"> <h3 id="t-2-2"> Is it possible to realize that pattern? If not, how do you like my suggestion? Of course, while generating the ids, it has to be checked by the software, if an ID exists already. Thanks. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
You cannot change that pattern in the settings. The id's are only used for headers in the TOC (ncx) when there are multiple headers in a file. If there is only one header, the id is not used.
Although you pattern seems nice, there is a big issue with it. It involves logic which might not be there. You assume a header/chapter numbering although it may not be there or follow a different pattern. Also, since the id's are only used in case of multiple headers of the same style in a file, inconsistent numbering will be the result. You can of course change it manual later. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
|
@Toxaris
"... involves logic which might not be there" You are right. I should specify my suggestion more precisely: The pattern should be used, when the complete TOC is based on Hn and when it is "well formed" - no gaps in the heading structure, no inconsistent order of levels. These editors get a smart pattern. The others not ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
g'day from Oz - see i get the pattern! ;) | pazed | Introduce Yourself | 3 | 07-24-2013 03:29 AM |
My reading pattern | Chi Cygni | General Discussions | 68 | 06-25-2012 04:23 PM |
Willow Pattern | spindlegirl | Deals and Resources (No Self-Promotion or Affiliate Links) | 14 | 06-15-2012 01:33 PM |
How do I specify TOC pattern? | PaulChernoch | Calibre | 5 | 10-10-2009 01:18 AM |