Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-18-2013, 08:42 PM   #1
ibu
Addict
ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.
 
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.
ibu is offline   Reply With Quote
Old 08-19-2013, 02:59 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
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.
Toxaris is offline   Reply With Quote
Advert
Old 08-19-2013, 03:17 AM   #3
ibu
Addict
ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.
 
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
ibu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 11:02 PM.


MobileRead.com is a privately owned, operated and funded community.