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 12-26-2014, 10:00 AM   #1
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Import files in order

I know it's in the manual, but I can't find it again (sorry)

I have a folder of list of html files (part1, part2 ... part10, part11, ... part33)that I wanted to build a book with, but the import order seems to be almost random

I recall that as I was reading the manual there was a way (toc file maybe) to provide an import order.

Could someone please provide a link?

I guess I couldn't come up with the right search terms (possibly due to OD-ing on eggnog???)

Thanks
phossler is offline   Reply With Quote
Old 12-26-2014, 11:18 AM   #2
theducks
Well trained by Cats
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: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by phossler View Post
I know it's in the manual, but I can't find it again (sorry)

I have a folder of list of html files (part1, part2 ... part10, part11, ... part33)that I wanted to build a book with, but the import order seems to be almost random

I recall that as I was reading the manual there was a way (toc file maybe) to provide an import order.

Could someone please provide a link?

I guess I couldn't come up with the right search terms (possibly due to OD-ing on eggnog???)

Thanks
Sigil has a 'Sort' (selected files) on the context menu. Maybe Kovid had a reason?

BUT
Your files would still (partially) fail because of ASCII sort rules
Part1
Part10
Part2
instead of
Part01
Part02
Part10
theducks is offline   Reply With Quote
Advert
Old 12-26-2014, 12:36 PM   #3
signum
Zealot
signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.
 
Posts: 119
Karma: 64428
Join Date: Aug 2011
Device: none
Here it is:

http://manual.calibre-ebook.com/faq....specific-order
signum is offline   Reply With Quote
Old 12-26-2014, 01:28 PM   #4
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
@signum -- yes, that was the reference I had seen before and vaguely recollected. I have to figure out how to use it

@theducks -- had I known the work I was making for myself, I would have planned ahead better

From the manual ...

Quote:
Note:
By default, when adding HTML files, calibre follows links in the files in depth first order. This means that if file A.html links to B.html and C.html and D.html, but B.html also links to D.html, then the files will be in the order A.html, B.html, D.html, C.html. If instead you want the order to be A.html, B.html, C.html, D.html then you must tell calibre to add your files in breadth first order. Do this by going to Preferences->Plugins and customizing the HTML to ZIP plugin.
So even with the PI option checked, the Sort Order logic would still order them as Part1, Part10, Part11, ..., Part2, Part20, ...

So the 'order' file is the only way

Correct?

Last edited by phossler; 12-26-2014 at 01:34 PM.
phossler is offline   Reply With Quote
Old 12-26-2014, 01:33 PM   #5
theducks
Well trained by Cats
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: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by phossler View Post
@signum -- yes, that was the reference I had seen before and vaguely recollected. I have to figure out how to use it

@theducks -- had I known the work I was making for myself, I would have planned ahead better

From the manual ...



So even with the PI option checked, the Sort Order logic would still order them as Part1, Part10, Part11, ..., Part2, Part20, ...

Correct?
Correct

Maybe you can use a file renamer like metamorpose, to pad the leading 0's
theducks is offline   Reply With Quote
Advert
Old 12-29-2014, 06:42 PM   #6
signum
Zealot
signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.
 
Posts: 119
Karma: 64428
Join Date: Aug 2011
Device: none
Sort Order and Depth-FIrst

I recently did some experiments with Calibre to see what actually happens when you specify an index file referencing several other html files. I had several questions:

1. Does Calibre change the order of included files?

I created 5 html files named part_1.html, part_2.html, part_10.html, part_11.html and part_20.html. Each file looks like:

Code:
<html><body>
  <p>This is file 1.</p>
</body></html>
with the "1" replaced with 2, 10, 11 or 20, as appropriate for each file.

I tried to create an epub from just these five files:

Code:
ebook-convert *.html foo.epub
but calibre wouldn't take it. So, following Kovid's recommendation in the documentation, I created an index file that looks like:

Code:
<html><body>
  <p><a href=file_1.html>file 1</a></p>
  <p><a href=file_2.html>file 2</a></p>
  <p><a href=file_10.html>file 10</a></p>
  <p><a href=file_11.html>file 11</a></p>
  <p><a href=file_20.html>file 20</a></p>
</body></html>
and created an epub:

Code:
ebook-convert index.html foo.epub
The order of the files in the epub was 1, 2, 10, 11, 20, just as in the index.html. From this, I conclude that calibre doesn't just bunch all the references together and then retrieve them in sort order. Further, there's no need to rename the files with leading zeros before single digits.

2. Well, just when depth-first order important?

Following Kovid's example, I changed file_2.html to include a link to file_11.html and made an epub out of this. The sequence of files turned out to be 1, 2, 11, 10, 20, just as Kovid warned it would be. The difference here is that there was a forward reference (in file_2.html) that needed to be chased down first.

3. What happens if you reverse the files in index.html?

I arranged the links in index.html to be in reverse order. File_2.html still linked to file_11.html, but now it's a backward link. Made an epub out of this and the order was 20, 11, 10, 2, 1 without any need for a depth-first search.

Conclusions:

Simple forward links at the top (index) level behave nicely, coming out in the same order you list them. Actually, it's a depth-first search where the depth is 1.
Forward links at the second (or lower) levels will include files in depth-first order.
Backward links don't change the include order at all.
signum is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Import .asp files? TheTruthBetween Library Management 3 11-16-2014 03:28 AM
how to import files in specific order. not resolved user743 Editor 29 05-21-2014 12:11 PM
Import order when adding multiple books Sparkling Library Management 5 07-08-2011 07:41 AM
iPad How can we import files to iPad? Over Apple Devices 15 10-20-2010 05:32 AM
Import pdf files pavlos555 Calibre 3 10-14-2010 10:18 AM


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


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