What’s in an ePUB?: The Root Directory

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.

ePUB3 Package Root folder shows two folders: Meta-INF and OPS, and a file called mimetype

Let’s take a look at each of those items.

1. The Mimetype

This file consists of one line of text:

mimetype file with one line of text that says application/epub+zip

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.

Shows the meta-INF folder which contains the container.xml file

Here is what is typically in the container.xml file:

Shows code that is present in a container.xml file. The code is as follows: <?xml version=“1.0” encoding=“UTF-8"?> <container version=“1.0” xmlns=“urn:oasis:names:tc:opendocument:xmlns:container”> 	<rootfiles> 		<rootfile full-path=“OEBPS/package.opf” media-type=“application/oebps-package+xml”/> 	</rootfiles> </container>

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.

OPS folder container several xhtml files, a CSS folder, font and images folders.

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.


Latest Resources

Need help with alt text?

If you're taking on the task of writing your own alt text, you may feel a bit overwhelmed—but eBOUND is here to help! Below is a downloadable template you can use with a few examples. You can use...