View Single Post
Old 08-18-2024, 10:40 AM   #1
vanceism7
Junior Member
vanceism7 began at the beginning.
 
Posts: 5
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