Introduction to the Navigation File
This Introduction to the Navigation File of an EPUB breaks down the elements that make up this important file.
This Introduction to EPUB Files breaks down the elements that make up an EPUB.
Foundations and Rationale
Before reading this, you might want to read:
This is a great question to ask. Even if you have been working with EPUB for a while, it is entirely possible and understandable that you might not know what makes it up!
An EPUB contains a set of files that make up the ebook. The files are packaged together, and that is what you are seeing when you look at an EPUB. You are probably familiar with unzipping .ZIP folders — well you can do the same with an EPUB, just by changing the file extension to .zip. Do this, and you can unzip the file to see the contents of the EPUB. (To change it back, simply change the file extension back, to .epub.) (Note that you may need another app or program to unzip the file, if your system won’t do it automatically – try The Unarchiver for Mac, or StuffIt for both Mac and PC.)
Inside the unzipped folder, you will see a document called mimetype, and two folders: “META-INF”, and “OPS” or “OEBPS” (OEBPS and OPS are the same thing, and you may see either name. They stand for OpenEbook Publication Structure and OpenPublication Structure – but this isn’t super important to know!).
The mimetype file tells the computer what the file is — simple! It has no extension, and just a single line of code:
The META-INF folder has one file in it: container.xml. This file points the reading system to the all-important OPF file (which we haven’t discussed yet – don’t worry!) The file will almost always consist of the following (if the book has an OPS file – otherwise, switch out OEBPS for OPS):
<?xml version="1.0" encoding="utf-8"?> <container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0"> <rootfiles> <rootfile full-path="OPS/content.opf" media-type="application/OPS-package+xml"/> </rootfiles> </container>
The OPS/OEBPS folder contains all of the content of the book itself — the text, the images, the CSS, fonts, other media files if they exist, etc. It also contains the navigation file (usually toc.xhtml or nav.xhtml) and the OPF. Sometimes, there is an NCX file — this is an older type of navigation file. The OPF is a complex document, which warrants its very own resource — see Related Content below.
All these items — the mimetype, META-INF, and the OPS/OEBPS folder with its CSS, XHTML/HTML documents, fonts, images, media, navigation file, and OPF, are all packaged together to create your wonderful EPUB. And, in case you were wondering, you can absolutely build up an EPUB from scratch, and make each one of these files. It’s a great way to learn!
Content Source Acknowledgement
eBOUND Canada: What’s in an EPUB File?: The OPS Folder