Mobileread
wrong order in epub
#1  vikarti 10-02-2020, 01:52 PM
I generated epub file from big collection of htmls. (via calibre)
Toc.ncx was manually generated in Calibre's editor and correct order.
Files themselves are not in correct order.
spine in metadata.ofx is also not in correct order.

Calibre's epub reader doesn't read book in correct order but shows toc.

Moon+ ignores toc.ncx


how to re-order book's files and spine according to order in toc.ncx? (it's difficult to move around approx 100 files with names like index-<3 random digits>.html )
Reply 

#2  hobnail 10-02-2020, 02:36 PM
I only use sigil but I'm guessing it's the same in Calibre's editor; you manually click and drag the html files up or down in the file browser on the left. Maybe/hopefully there's something better because that will be tedious.
Reply 

#3  JSWolf 10-02-2020, 07:58 PM
Quote hobnail
I only use sigil but I'm guessing it's the same in Calibre's editor; you manually click and drag the html files up or down in the file browser on the left. Maybe/hopefully there's something better because that will be tedious.
Yes it is the same way (n Calibre) of dragging the HTML file up/down until they are in the correct order.
Reply 

#4  vikarti 10-03-2020, 01:48 AM
Why toc.ncx is ever needed if it couldn't be used by almost anything?
Ok. is there way to at least rename files according to names in toc.ncx?
Reply 

#5  DNSB 10-03-2020, 02:26 AM
Quote vikarti
Why toc.ncx is ever needed if it couldn't be used by almost anything?
Ok. is there way to at least rename files according to names in toc.ncx?
toc.ncx as you may have guessed from the name is a table of contents navigation document. On my Kobo ereader, when I look at an epub2, that's the file that supplies the table of contents. For epub3, it is replaced by a XHTML navigation document rather often called nav.xhtml though many epub3 also have a toc.ncx for use by older renderers.

IF the HTML ToC file associated with the html file collection you imported has the files in the correct order, the files will be imported in the correct order. If you just imported a bunch of files, well, GIGO.

See this message thread Importing HTML files with the wrong chapter order and this link to the calibre FAQs: How do I convert a collection of HTML files in a specific order? for a bit more information. Note the breadth and depth first option as this has bit me on the butt on a couple of occasions.
Reply 

#6  vikarti 10-03-2020, 07:53 AM
Quote DNSB

IF the HTML ToC file associated with the html file collection you imported has the files in the correct order, the files will be imported in the correct order. If you just imported a bunch of files, well, GIGO.

See this message thread Importing HTML files with the wrong chapter order and this link to the calibre FAQs: How do I convert a collection of HTML files in a specific order? for a bit more information. Note the breadth and depth first option as this has bit me on the butt on a couple of occasions.
Thanks!
Given that it's rather easy to generate html toc from arleady existing toc.xml - this was good enough solution for my puproses. I unpacked book and re-imported with breath-first option enabled (calibre restart was necessary for it to be applied for some reason).
Reply 

#7  JSWolf 10-03-2020, 08:12 AM
Quote vikarti
Why toc.ncx is ever needed if it couldn't be used by almost anything?
Ok. is there way to at least rename files according to names in toc.ncx?
The NCX is the ToC. It's used in most cases. If it's not used, it's the fault of the reading software. For example, on my H2O, the ToC controls display the NX ToC. Then having a link in that to go to the HTML ToC is silly as you then change page to get there when you are already at the ToC.

Calibre and Sigil have ToC editors.
Reply 

#8  DNSB 10-03-2020, 05:14 PM
Quote vikarti
Thanks!
Given that it's rather easy to generate html toc from arleady existing toc.xml - this was good enough solution for my puproses. I unpacked book and re-imported with breath-first option enabled (calibre restart was necessary for it to be applied for some reason).
Good to hear that my advice was helpful to you.
Reply 

Today's Posts | Search this Thread | Login | Register