![]() |
#1 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Run fix html or beautify before splitting.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Hmm, ok I will take a look at it when I have a moment.
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
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. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
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. |
![]() |
![]() |
![]() |
#8 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
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
|
![]() |
![]() |
![]() |
#10 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#11 | |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,209
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
I find epubcheck and similar schema based validation tools drown the signal in the noise. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |