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 04-18-2013, 03:55 PM   #1
curiousgeorge
Connoisseur
curiousgeorge began at the beginning.
 
Posts: 53
Karma: 10
Join Date: Aug 2012
Location: Nashville, Tn
Device: ipad, Kindle Fire
Diagnosing a Sigil ID nightmare

I'm correcting an epub that has havoc reined by Sigil. For some apparent reason the particular person asked me to examine there epub and I said ok before looking at it. Now I have a 600 page epub with almost 2500 lines of code from Sigil that has duplicate ids. Can someone please explain this process to me and why Sigil does this? I typically only hand code my epubs.

Code:
<p class="tx" id="d7e791985">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

<p class="tx" id="d7e791985">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

<p class="tx" id="d7e791985">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
Text removed but you get the idea. Thanks!
curiousgeorge is offline   Reply With Quote
Old 04-18-2013, 04:09 PM   #2
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,430
Karma: 5560777
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by curiousgeorge View Post
I'm correcting an epub that has havoc reined by Sigil. For some apparent reason the particular person asked me to examine there epub and I said ok before looking at it. Now I have a 600 page epub with almost 2500 lines of code from Sigil that has duplicate ids. Can someone please explain this process to me and why Sigil does this? I typically only hand code my epubs.

Code:
<p class="tx" id="d7e791985">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

<p class="tx" id="d7e791985">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

<p class="tx" id="d7e791985">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
Text removed but you get the idea. Thanks!
Just remove them
You only need id's to link, and then, only if not at the top of file.
theducks is offline   Reply With Quote
Old 04-18-2013, 04:37 PM   #3
curiousgeorge
Connoisseur
curiousgeorge began at the beginning.
 
Posts: 53
Karma: 10
Join Date: Aug 2012
Location: Nashville, Tn
Device: ipad, Kindle Fire
I know that. My apologies for not explaining what I meant. Im curious to know WHY Sigil does it.
curiousgeorge is offline   Reply With Quote
Old 04-18-2013, 05:03 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,875
Karma: 39839185
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by curiousgeorge View Post
I know that. My apologies for not explaining what I meant. Im curious to know WHY Sigil does it.
There would normally have to be something drastically wrong with the epub in the first place for Sigil to make anything other than small changes to the code on it's own. I find it highly doubtful that Sigil auto-inserted a bunch of ids into p tags (duplicate or otherwise), myself. Not unless it was handed a complete mess to begin with and it just did its best cope. It'd be nice to see a sample of what the epub looked like before you opened it in Sigil.
DiapDealer is online now   Reply With Quote
Old 04-19-2013, 01:45 AM   #5
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,892
Karma: 4632610
Join Date: Dec 2010
Device: Kindle PW2
As DiapDealer already pointed out, it's highly unlikely that Sigil did this. Since styles can also be assigned by ids, it's possible that these duplicated ids are used for style assignments.

Did you check the stylesheet for id based styles? For example:

Code:
#d7e791985 {
    text-align: center;
}
Doitsu is offline   Reply With Quote
Old 04-19-2013, 10:04 AM   #6
curiousgeorge
Connoisseur
curiousgeorge began at the beginning.
 
Posts: 53
Karma: 10
Join Date: Aug 2012
Location: Nashville, Tn
Device: ipad, Kindle Fire
yes I have checked the CSS and Im told the entire epub was created in Sigil. I never use Sigil so I wanted to know from here if this is something common Sigil does.
curiousgeorge is offline   Reply With Quote
Old 04-19-2013, 10:40 AM   #7
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,430
Karma: 5560777
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
id is not class
I would not expect to see that value in the CSS.

' class="tx" '

That book may have started elsewhere and was malformed at import.
Tidy, then *fixed* it

Remember
GIGO
theducks is offline   Reply With Quote
Old 04-19-2013, 11:26 AM   #8
curiousgeorge
Connoisseur
curiousgeorge began at the beginning.
 
Posts: 53
Karma: 10
Join Date: Aug 2012
Location: Nashville, Tn
Device: ipad, Kindle Fire
lol you say that but the horror stories I can talk about..
curiousgeorge is offline   Reply With Quote
Old 04-19-2013, 11:49 AM   #9
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,892
Karma: 4632610
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by theducks View Post
id is not class
I would not expect to see that value in the CSS.
Me neither, but it's perfectly acceptable. For example the following code:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  
<style type="text/css">
#d7e791985 {
    text-align: center;
    color: red;
  }
</style>
</head>

<body>
  <p id="d7e791985">A centered, red paragraph.</p>
</body>
</html>
displays fine in Sigil and ADE, passes epubcheck and compiles OK with KindleGen.

However, since the original epub creator didn't use these particular ids to assign a style and apparently doesn't reference them anywhere else, it looks more like a global search and replace action gone awry.
Doitsu is offline   Reply With Quote
Old 04-23-2013, 09:27 AM   #10
curiousgeorge
Connoisseur
curiousgeorge began at the beginning.
 
Posts: 53
Karma: 10
Join Date: Aug 2012
Location: Nashville, Tn
Device: ipad, Kindle Fire
it wont pass epubcheck because it goes back to HTML validation in regards to duplicate ids

such as:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  
<style type="text/css">
#d7e791985 {
    text-align: center;
    color: red;
  }
</style>
</head>

<body>
  <p id="d7e791985">A centered, red paragraph.</p>
  <p id="d7e791985">A centered, red paragraph.</p>
</body>
</html>
curiousgeorge is offline   Reply With Quote
Old 04-23-2013, 10:07 AM   #11
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,892
Karma: 4632610
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by curiousgeorge View Post
it wont pass epubcheck because it goes back to HTML validation in regards to duplicate ids
I never said that an epub with multiple identical ids would pass epubcheck.
I merely wanted to show that ids can also be used to assign styles.
Doitsu is offline   Reply With Quote
Old 04-23-2013, 11:22 AM   #12
curiousgeorge
Connoisseur
curiousgeorge began at the beginning.
 
Posts: 53
Karma: 10
Join Date: Aug 2012
Location: Nashville, Tn
Device: ipad, Kindle Fire
Quote:
Originally Posted by Doitsu View Post
I never said that an epub with multiple identical ids would pass epubcheck.
I merely wanted to show that ids can also be used to assign styles.
ok good, I was scared a minute there
curiousgeorge is offline   Reply With Quote
Old 05-23-2013, 01:17 AM   #13
LukeA
Member
LukeA began at the beginning.
 
Posts: 14
Karma: 10
Join Date: May 2013
Device: Sony Reader PRS T1
Copying and pasting in Sigil copies ids as well as everything else. If you are in book view you won't know this - it is only obvious in code view. I've found that just fiddling with paragraphs can result in duplicate ids across successive paragraphs without copying.

It seems to me that if duplicate ids are forbidden, Sigil should be smart enough to not create duplicate ids automatically - when copying, it should generate a new id for the pasted item. Ditto for generating multiple paragraphs out of one.
LukeA is offline   Reply With Quote
Old 05-23-2013, 03:13 AM   #14
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 2,303
Karma: 12005829
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
Quote:
Originally Posted by LukeA View Post
Copying and pasting in Sigil copies ids as well as everything else. If you are in book view you won't know this - it is only obvious in code view. I've found that just fiddling with paragraphs can result in duplicate ids across successive paragraphs without copying.

It seems to me that if duplicate ids are forbidden, Sigil should be smart enough to not create duplicate ids automatically - when copying, it should generate a new id for the pasted item. Ditto for generating multiple paragraphs out of one.
+1! LukeA beat me to it. I was about to say, some noob created a paragraph style, in CV (Code View), and without thinking, switched over to BookView and started typing by hitting "enter" and typing merrily on, or cutting and pasting paragraphs (probably from a PDF, heavens help us, if not Word) into BV. Sigil did what it is supposed to do; it duplicated the previous paragraph style and class. Thus, you have tens of thousands of paragraphs with an id present. This is what happens when a DIY'er reads some posting on the KDP forum and decides to use Sigil like a word-processor. Fortuitously, you can simply regex that out, and the ePUB should pass validation--assuming everything else is fine.

Given how basic that error is, though, I wouldn't count on not finding other mistakes just as basic and just as painful.

Quote:
It seems to me that if duplicate ids are forbidden, Sigil should be smart enough to not create duplicate ids automatically - when copying, it should generate a new id for the pasted item. Ditto for generating multiple paragraphs out of one.
Don't see why, and I'd say, not necessarily. Do you seriously think that Sigil should have generated thousands of new id's for the thousands of paragraphs in that ePUB of 600 printed pages? Crap, I'd rather regex 10,000 identical id's than 10,00 different ones had I made that mistake (and don't think that I didn't make one that dumb, a long time ago). ;-) Sigil's not a word-processor; it assumes that its users are smart enough to know HTML, XHTML and CSS. {smile}.

Hitch
Hitch is offline   Reply With Quote
Old 05-23-2013, 04:52 AM   #15
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,892
Karma: 4632610
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Hitch View Post
Don't see why, and I'd say, not necessarily. Do you seriously think that Sigil should have generated thousands of new id's for the thousands of paragraphs in that ePUB of 600 printed pages? Crap, I'd rather regex 10,000 identical id's than 10,00 different ones had I made that mistake (and don't think that I didn't make one that dumb, a long time ago). ;-) Sigil's not a word-processor; it assumes that its users are smart enough to know HTML, XHTML and CSS. {smile}.
Actually, generating new unique ids for paragraphs isn't that complicated in Sigil. Thanks to the comprehensive Index code implemented by Meme, all you have to do is:
  1. Delete all paragraph ids and select Tools > Index > Index Editor.
  2. Right-click the Index Editor window and select Autofill.
  3. Select Tools > Index > Create Index.
This will cause Sigil to automatically add consecutive ids to each paragraph in the epub. (Not that they'll be particularly useful.)

Last edited by Doitsu; 05-23-2013 at 03:07 PM.
Doitsu 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
TOC Nightmare, Help please! oasis88 Workshop 2 09-24-2012 08:15 AM
Help diagnosing SIGSEGV issue seabream Plugins 3 07-31-2012 11:58 PM
An UPS nightmare: can someone help me? central11 Amazon Kindle 52 08-12-2011 05:12 PM
The Nightmare Within now just $.99! Glen Krisch Self-Promotions by Authors and Publishers 8 05-05-2011 07:41 PM
HP Nightmare Bob Russell Lounge 27 05-10-2007 04:37 PM


All times are GMT -4. The time now is 06:29 PM.


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