Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-12-2012, 03:47 AM   #1
TrevN
New to ePub learnin' fast
TrevN began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2012
Location: Perth, Western Australia
Device: Kindle Touch & iPad 3
Question Sigil won't save changes to id attribute in h1 tag

I noticed Sigil had given the same id attribute (heading_id_2) to the h1 tags in most (but not all) of my xhtml files. I changed them all so they were numbered consecutively (heading_id_1, heading_id_2, ....._3, etc) and saved the book. When I opened up the book again, in Sigil, it changed all the id attributes back to heading_id_2.

Does anyone know why this happens and how to overcome it?
TrevN is offline   Reply With Quote
Old 09-12-2012, 06:01 AM   #2
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 1,939
Karma: 4633610
Join Date: Dec 2010
Device: Kindle PW2
AFAIK, Sigil uses the heading_id tags for the automatic TOC generation. For some odd reason it restarts numbering for each .xhtml source page, however, this doesn't affect TOC generation.

If you want consecutive id tags to simplify the generation of an inline TOC, activate the regular expressions mode, search for id="heading_id_\d+" and replace it with nothing.

Then use a regular expression to add a heading id number based on the chapter number and regenerate the TOC. For example, for a simple h1 chapter heading that contains only the chapter number (e.g. <h1>12</h1>) you'd use:

Find: <h1>(\d+)</h1>
Replace: <h1 id="heading_id_\1">\1</h1>
Doitsu is offline   Reply With Quote
Old 09-12-2012, 12:28 PM   #3
mmat1
Det
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 954
Karma: 1131766
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by TrevN View Post
I noticed Sigil had given the same id attribute (heading_id_2) to the h1 tags in most (but not all) of my xhtml files. I changed them all so they were numbered consecutively (heading_id_1, heading_id_2, ....._3, etc) and saved the book. When I opened up the book again, in Sigil, it changed all the id attributes back to heading_id_2.

Does anyone know why this happens and how to overcome it?
I never noticed this behaviour, Sigil never changes id's which are already there. Even if you press "Create toc from headings"

This behaviour will result in duplicate id's if you merge 2 files.

Sorry, but test it again !
mmat1 is offline   Reply With Quote
Old 09-12-2012, 09:41 PM   #4
TrevN
New to ePub learnin' fast
TrevN began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2012
Location: Perth, Western Australia
Device: Kindle Touch & iPad 3
Guys - thanks for your responses. I tried it again and this time it worked ok. User error first time around, no doubt, but I don't know what I did wrong. Oh well.

TrevN is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please clarify tag name, attribute and value in Mobipocket Creator? Michael_jones Kindle Formats 0 11-22-2011 04:10 PM
'NoneType' object has no attribute 'tag'? gweminence Calibre 7 09-13-2011 10:03 AM
h3 tag is being changed on save 1611mac Sigil 5 04-22-2011 05:04 PM
Open and save an epub in sigil - won't load in Freda p1000 Sigil 1 08-01-2010 01:32 PM
tag <br /> causes epubeck error: attribute clear not allowed georg3200 ePub 21 11-19-2009 08:50 PM


All times are GMT -4. The time now is 05:37 AM.


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