09-03-2010, 06:12 PM | #1 |
Junior Member
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Sony PRS600B
|
Order of Chapters in HTML->ePub
I am trying to convert a HTML book to ePUB, it works perfectly except the chapters are all out of order.
The HTML files are named chapter_1.html, chapter_2.html etc. Is there any way I can cause it to recognise them in order, I don't mind some manual editing. I already tried renaming the titles within the headers to 1->01, 2->02 etc to see if that helped, but the order just seems very random. If anyone can suggest a solution I'd be grateful. Thanks |
09-03-2010, 08:17 PM | #2 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
During conversion this main page or TOC will be used to keep the chapters in order. |
|
Advert | |
|
09-03-2010, 08:50 PM | #3 | |
Junior Member
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Sony PRS600B
|
Thanks
Quote:
The files are ordered correctly in the directory name "_chapter 01.htm" ... "_chapter 21.htm" doesn't seem to work. Any Further suggestions? |
|
09-03-2010, 09:00 PM | #4 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
I need some clarification, are the chapters in order in the book? Ignoring the TOC if you read the book straight through are the chapters physically in order? |
|
09-03-2010, 09:02 PM | #5 | |
Junior Member
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Sony PRS600B
|
Quote:
If I read through Chapter one, it jumps to Chapter 29. |
|
Advert | |
|
09-03-2010, 09:04 PM | #6 |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
|
09-03-2010, 09:11 PM | #7 |
Junior Member
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Sony PRS600B
|
Yes, it works ok in the browser, in HTML format, but then that's via links because since it's seperate files it doesn't change chapters until I click the next one.
I'm assuming the problem much be in the chapter search algorithm/expression. I am corrently playing with modifying the filenames and links but it takes a while as it's a 2000 page book and takes forever (2-3 minutes) to convert even on a high end PC. |
09-03-2010, 10:32 PM | #8 |
creator of calibre
Posts: 44,353
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre follows links in depth first order if I remember correctly. If your files contain interlinks that can mess up the ordering. I would suggest using an EPUB editor to fix the ordering post conversion, or use the command line ebook-convert tool with the --breadth-first option to convert the html.
|
09-03-2010, 10:35 PM | #9 | |
Junior Member
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Sony PRS600B
|
Thanks
Quote:
I think I found a solution however. I extracted the epub with 7zip and found the toc.ncx which is a plain text XML file, in here the chapters appear in the same incorrect order they do when viewing, as long as I can modify this and zip it back up I should be good to go. Last edited by alias_neo; 09-03-2010 at 10:36 PM. Reason: typo |
|
05-16-2011, 11:55 AM | #10 |
Wizard
Posts: 1,669
Karma: 2300001
Join Date: Mar 2011
Location: Türkiye
Device: Kindle 5.3.7
|
if you ensure that the first link is to next html file on each html file, then calibre gives no error on page order. (On my book I put an 1*1 white image file with links to following page on the top of each page. Outcome was awesome. (I'm aware of the dates. This is for the future reference)
ie: Code:
<body topmargin="0" > <div align="center"><center> <table border="0" cellspacing="1" > <tr> <td valign="top"><a href="1569.htm" target="_self"><img src="../images/b42.gif" border="0" width="1" height="1"></a></td> </tr> </table> </center></div> <p>........ Last edited by thomass; 05-16-2011 at 08:26 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
RTF to ePub, Chapters | Daddy Warpig | Calibre | 6 | 05-11-2010 11:06 PM |
Make chapters for a document/HTML | iodine9176 | ePub | 12 | 02-23-2010 02:24 PM |
chapters (HTML-files) not showing up | erik5000 | ePub | 1 | 12-21-2009 04:22 PM |
ePub Chapters vs. Stanza Chapters | kjk | Sigil | 4 | 09-14-2009 10:50 AM |
Multi-html files as chapters... | WigglePig | Sony Reader | 5 | 09-16-2008 04:06 AM |