Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 10:40 AM   #1
vanceism7
Junior Member
vanceism7 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2024
Device: Pixel 4a
Create ebook using filesystem structure

Hello, I've been trying to create an ebook from a collection of html files and wondering if someone can help me out.

The basic story is that I have a collection of html files stored in my filesystem with this basic type of hierarchy:

Book

├── 1-Foo
│ ├── chapter-1.html
│ ├── chapter-2.html
│ └── chapter-3.html

├── 2-Bar
│ ├── chapter-1.html
│ └── chapter-2.html

├── 3-Baz
│ ├── chapter-1.html
│ ├── chapter-2.html
│ └── chapter-3.html

My question is, is there anyway to convert my collection of files sorted like above into an ebook in Calibre such that the TOC and ordering of the book follows this structure?

So far, I've tried creating an index.html file which references all of the above files in order, and also just zipping the book folder and loading it into Calibre - in either case, Calibre throws the chapters into a completely random order.

I've been reading the Calibre manual and they say it uses all kinds of complicated processes to determine the ordering and chapters of the book, but in my case, the work has already been done, it's just that Calibre doesn't understand it.

I'm fine with creating a TOC if need be, but I can't find any info on how to manually create a TOC file or how to tell Calibre to use that TOC if I created one.
I also don't want to edit the TOC using the book editor, my hope is to generate it using scripts since I can do this easily based off the filesystem structure of the files.

But if there's a way to have Calibre infer the structure and ordering of the book from the filesystem automatically, that would be ideal!

Any help anyone could provide here would be greatly appreciated! Thanks so much!
vanceism7 is offline   Reply With Quote
Old Today, 11:02 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,229
Karma: 23446430
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://manual.calibre-ebook.com/faq...specific-order
kovidgoyal is offline   Reply With Quote
Old Today, 12:30 PM   #3
vanceism7
Junior Member
vanceism7 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2024
Device: Pixel 4a
Sorry, so that was the first thing that I tried. Calibre seems to ignore the ordering of the html file and pulls in the chapters in a completely random order when I do that.

Ah sorry, just noticed the breadth-first ordering. I tried this with the CLI but was getting errors that my html files were ignored because they were binary files. But I just read theres an option to set it in the GUI - ill give it a try

Last edited by vanceism7; Today at 12:34 PM.
vanceism7 is offline   Reply With Quote
Old Today, 12:39 PM   #4
vanceism7
Junior Member
vanceism7 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2024
Device: Pixel 4a
Ok, so even using breadth-first ordering still results in a totally random chapter ordering
vanceism7 is offline   Reply With Quote
Old Today, 02:22 PM   #5
vanceism7
Junior Member
vanceism7 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2024
Device: Pixel 4a
Update:

Ok so, I atleast found a workaround. I wrote a script that traverses my book files in the order I want, and appends each one to a combined html file, and then I supply that file to `ebook-convert` and that will cause calibre to render the chapters in the correct ordering. Just FYI for anyone else looking for a cheap solution to this in the meantime
vanceism7 is offline   Reply With Quote
Old Today, 03:00 PM   #6
slm
Fool
slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.
 
Posts: 395
Karma: 3557934
Join Date: Feb 2003
Device: Kindle: Voyage,PW1,KOA, Kobo: Clara Colour, Nook GLP, Pocketbook verse
Did you actually try creating an HTML "table of contents" file as indicated by the link and then asking Calibre to add that file?
slm is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create tags while importing from source folder structure eamonned Library Management 5 01-28-2019 09:37 AM
Create TOC from non linear structure Cilex Conversion 3 10-01-2016 08:16 PM
Development eDGe Library filesystem and backup structure kenjennings enTourage Archive 3 05-26-2011 01:29 PM
Development eDGe Library filesystem and backup structure kenjennings enTourage Archive 0 04-27-2011 01:57 AM
How to create "Genre" expandable tree structure in Tag Browser? meads Library Management 3 02-20-2011 02:43 PM


All times are GMT -4. The time now is 07:25 PM.


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