View Single Post
Old 02-17-2011, 12:01 AM   #2
pholy
Booklegger
pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.
 
pholy's Avatar
 
Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
Making an onmibus out of epub files...

It's a little hard to describe, but I think I know how I would go about it. You have to understand how epubs are put together, so let me know if you need to learn that bit too.

First I would unzip each book into its own directory, then, I would create a destination work directory. Put the mimetype file and the META-INF directory (with its container.xml file) in the work directory. Now your omnibus volume will need a single content.opf file and a single toc.ncx file, so create empty files for them in the work directory.

Here's where things will get tricky. For each book, create a directory in the work directory. Into the book directory, copy the font, image, css, and html files from the unzipped epub directory. Do not copy the content.opf and toc.ncx files into the book directory. Instead, use the contents of those file to create the new content.opf and toc.ncx file in the work directory.

The new content.opf file will have a new metadata section describing your omnibus, but the manifest and spine sections will be made by combining those sections from each of your books, remembering to add in the new book directory into each file's path.

The new toc.ncx file will also be made by combining the existing toc files, but you will probably want to make a two (or more) level table of contents. The outer level will be new, with an entry for each book, then between each of those entries you can put the entries from each book's toc.ncx file. By the way, in Windows, you would be using Notepad++ to create these files, not Notepad or Word. In Linux, I'd use vim or gedit.

Once all that's done, zip it up and see if it validates using FlightCrew; then fix the errors until it does...

Do you begin to see why Sigil doesn't do this for you automatically? Oh, and by the way, I haven't actually done this for any collection of books, so I'm sure I left out lots of details that will bite me the first time I try it. If anybody has other suggestions, feel free to toss them into the pot.

Last edited by pholy; 02-17-2011 at 12:02 AM. Reason: Separate the paragraphs
pholy is offline   Reply With Quote