Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 02-16-2014, 06:41 AM   #1
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Splitting

When I tried to split my document at the start of Contents, it split at a different place, the start of the list of tables. When I went back to try to split it where I wanted to I got:

calibre, version 1.24.0
ERROR: Unhandled exception: <b>IndexError</b>:tuple index out of range

calibre 1.24 [64bit] isfrozen: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.5
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Traceback (most recent call last):
File "site-packages\calibre\gui2\tweak_book\boss.py", line 72, in ans
File "site-packages\calibre\gui2\tweak_book\boss.py", line 889, in split_requested
File "site-packages\calibre\ebooks\oeb\polish\split.py", line 172, in split
File "site-packages\calibre\ebooks\oeb\polish\toc.py", line 358, in node_from_loc
IndexError: tuple index out of range
Attached Files
File Type: epub guarding1.epub (5.98 MB, 291 views)
mrmikel is offline   Reply With Quote
Old 02-16-2014, 06:44 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,380
Karma: 23764838
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Run fix html or beautify before splitting.
kovidgoyal is offline   Reply With Quote
Old 02-16-2014, 06:47 AM   #3
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
I ran beautify and it worked just the same way. Ditto with fix html.

I had run check book multiple times to get rid of all the errors before.
mrmikel is offline   Reply With Quote
Old 02-16-2014, 08:33 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,380
Karma: 23764838
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Hmm, ok I will take a look at it when I have a moment.
kovidgoyal is offline   Reply With Quote
Old 02-16-2014, 10:27 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,380
Karma: 23764838
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Your problem is caused by having <h3> inside <p> which is illegal in HTML and causes the block counting to get thrown off. See

<p>
<h3>The Authors</h3>
</p>

Fix that and you will be fine. Unfortunately, because that file is valid XML (but not valid HTML) the Fix HTML tool does not catch and fix that error, since trying to detect invalid html inside valid XML is rather expensive.
kovidgoyal is offline   Reply With Quote
Old 02-16-2014, 10:39 AM   #6
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Thanks. This is the price of dealing with website copied HTML- no headings and shoehorning them in.

Is there a chance of being able to do these one at time from the code window side without having to do xpath?

Last edited by mrmikel; 02-16-2014 at 10:46 AM.
mrmikel is offline   Reply With Quote
Old 02-16-2014, 11:27 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,380
Karma: 23764838
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
xpath is not that hard, just add

id="split-here"

to the tag you want to split at and then in the xpath dialog click the wizard and type id in the "Having attribute" box and split-here in the "With value" box.
kovidgoyal is offline   Reply With Quote
Old 02-16-2014, 11:39 AM   #8
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
I did it. I had to leave out h3 in the top box, which I assumed I needed.

It certainly is easy enough to put in the breaks this way. And they will go where I put them, regardless of whatever funky code there is.

I'm going to run the html/xml defective code through epubcheck to see if it catches it.

Later, it did catch it, but it takes some thought to figure out what they are getting at.

Last edited by mrmikel; 02-16-2014 at 11:46 AM.
mrmikel is offline   Reply With Quote
Old 02-18-2014, 03:56 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,380
Karma: 23764838
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I've added some code to make the editor catch invalid markup like that and auto-fix it during splitting. https://github.com/kovidgoyal/calibr...7c87ed082083ef
kovidgoyal is offline   Reply With Quote
Old 02-18-2014, 06:37 AM   #10
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Thank you very much. I have just brought in yet another web site book. It was offered as html or pdf. I figured an pdf conversion would be even worse!

BTW, your check book messages are generally more useful than Flight Crew or epubcheck. They nearly always get you closer to the "scene of the crime"!

Last edited by mrmikel; 02-18-2014 at 09:17 AM.
mrmikel is offline   Reply With Quote
Old 02-18-2014, 08:10 AM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,380
Karma: 23764838
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by mrmikel View Post
BTW, your check book messages are generally more useful than Flight Crew or epubcheck. They nearly always get you closer to the "scene of the crime.!
Indeed, one of my main design principles for Check Book is to have it output only useful messages, as far as possible. And have it automatically fix trivial bookkeeping mistakes so that the human can concentrate on the real problems.

I find epubcheck and similar schema based validation tools drown the signal in the noise.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Splitting a book HarryT Editor 9 02-11-2014 02:16 AM
Help with splitting tags Illyrie Library Management 3 11-11-2012 06:12 PM
Splitting Library Giuseppe Chillem Calibre 0 11-02-2010 02:00 PM
Splitting an ebook in 2 Spectralist Workshop 5 06-07-2009 08:01 AM
Splitting help needed tibiafry Workshop 1 05-18-2009 08:16 AM


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


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