The ePUB3 Package
When you first unzip an ePUB, you’ll see two folders and a file in the root directory: the mimetype, the META-INF and the OPS.
Let’s take a look at each of those items.
1. The Mimetype
This file consists of one line of text:
To create a mimetype, you simply type that line of text into a Text editor. This file explains to the computer that the archive is an ePUB, and needs to be read using an engine that can handle ePUBs. It must be the first file added to your ePUB folder when you are creating a new ePUB. Some scripts and programs will automatically place it first, but on a PC, if you are zipping manually, you need to make sure to drop it into the ePUB folder first.
It doesn’t have a file extension; it should just be named mimetype.
2. The META-INF Folder
Inside the META-INF folder is an XML file called container.xml that points the ebook to the OPF file.
Here is what is typically in the container.xml file:
This is the XML file that describes the ebook. You don’t really need to change anything in this code, you should be able to copy and paste it for every ebook you create. Sometimes, the directory is called an OPS rather than OEBPS. If that’s the case, then you need change it to OPS in the <rootfile> element too.
3. The OPS Folder
The OPS or OEBPS folder is where all of the content of your ebook lives.
Typically, each chapter in the book will have its own HTML or XHTML page, as will any ancillary materials like the copyright page, title page, preface, epigraph, etc.
Different types of media need their own folders, so you should create a folder to house all of the images contained within the book, and another for fonts, and one for the CSS. If your book has any audio/video materials, those would need their own folders, too.