STEP 6: EPUB IT
Create your base EPUB from the template in the Starter Package you downloaded in Step 4.
Getting started with the package
Considering you successfully extracted your original book to be made accessible, by now, you should have the image and metadata reference sheets populated and suited with details required as per the book. The Mata and I folder is our template.
- Navigate into the Guide Package folder.
- Right-click on the Mata and I folder and rename it to match the title of the book want to make accessible. ("Book_X")
- Click into the renamed folder, "Book_X" .
- Click again into the "EPUB" folder to have such a view of the files and folders inside the "EPUB" folder .
Owning the Template
1. Replacing the images
Navigate into the images folder (.../Book_X/Guide Package/Book_X/EPUB/images/) from the EPUB directory to access all the images for the the template.
You should have the images from your original book to be made accessible extracted and ready!
- Replace the front and back cover images with the respective images of your book to be converted.
Preserve the same names for the front and back covers as cover.jpg and bcover.jpg respectively.
- Swap out the images in the /EPUB/images folder with your extracted images for your book maintaining the naming convention of img01, img02, img03....
Use of JPEG images recommended!
All images to reside in the /images folder.
2. Replacing the Metadata
The metadata is most basic information about the book. The book's metadata is contained in the content.opf file in .../Book_X/Guide Package/Book_X/EPUB/content.opf location.
NOTE: The <metadata></metadata> section of the content.opf file lists information about the publication.
To replace the metadata details:
Ensure you are in the location .../Book_X/Guide Package/Book_X/EPUB/
- Look for and open the content.opf file using the editor of you choice.
- Find the <metadata></metadata> section
Replace the metadata values within the appropriate metadata properties of the content.opf file to suit the information about your publication content on the last column.
Use the Metadata Reference Sheet you populated after extraction to quickly map and replace the metadata values in the required metadata properties of the template.
- Save the changes. NOTE : DO NOT close the file in the editor.
Below table is a copy of the table in the Metadata Reference Sheet
Current Value(s) For Mata and I
Replace With Your Book’s Metadata Value(s)
|1||dc:title||Title of the publication||Mata and I|
|2||dc:identifier||Element contains a single identifier associated with the given Rendition of the EPUB Publication, such as a UUID, DOI, ISBN or ISSN.||N/A|
|Language used in the publication.||en-us|
|4||dcterms:modified||Date when the content of the publication was last modified.||2018-06-26T15:30:00Z|
|5||dc:creator||Author credited with the creation of the resource.||Tusome Early Literacy Programme|
|6||dc:publisher||The organization credited with publishing the resource.||Tusome Early Literacy Programme|
|7||dc:date||Date which the resource was created.||2017-12-22|
|8||meta property file-as=" "||Match the dc:creator value||Tusome Early Literacy Programme|
|9||dc:source||A related resource from which the described resource is derived.|
Title : Mata and I, Publisher : Tusome Early Literacy Programme, Year : 2017, Kenya
Metadata section from an editor:
The accessibility metadata is very critical to enhance image and other accessibility features and thus should be maintained as per the template. The inclusion of accessibility metadata in the Schema.org collection helps persons to easily find content that meets their individual needs and preferences.
3. Changing the OPF Manifest and Spine
The manifest is an unordered list of all of the files within the OEBPS/OPS/EPUB directory. It is contained in the content.opf file in .../Book_X/Guide Package/Book_X/EPUB/ .
Each item in the manifest has three components
An item ID, which you can make up, and should describe the file:
A reference to the actual file:
The media-type, which tells the parser what type of file it is:
- Media types can either be:
To make changes in the Manifest section:
- Ensure the content.opf file is still open for editing using the editor of your choice.
- Move to the manifest section within the following tags <manifest></manifest>.
Add any necessary media type using the syntax below:
<item id="cover" href="images/cover.jpg" media-type="image/jpeg"/>XML
- Save the changes to the file. DO NOT close the file in the editor.
<manifest> <item id="font01" href="fonts/GillSansMt-Schlbk.ttf" media-type="application/vnd.ms-opentype"/> <item id="font02" href="fonts/GillSansMt-SchlbkBold.ttf" media-type="application/vnd.ms-opentype"/> <item id="font03" href="fonts/OpenDyslexic3-Regular.ttf" media-type="application/vnd.ms-opentype"/> <item id="Cover" href="cover.xhtml" media-type="application/xhtml+xml"/> <item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/> <item id="ch01" href="ch01.xhtml" media-type="application/xhtml+xml"/> <item id="Bcover" href="bcover.xhtml" media-type="application/xhtml+xml"/> <item id="cover-image" href="images/cover.jpg" media-type="image/jpeg" properties="cover-image"/> <item id="image201" href="images/img01.jpg" media-type="image/jpeg"/> <item id="image202" href="images/img02.jpg" media-type="image/jpeg"/> <item id="image203" href="images/img03.jpg" media-type="image/jpeg"/> <item id="image204" href="images/img04.jpg" media-type="image/jpeg"/> <item id="image205" href="images/img05.jpg" media-type="image/jpeg"/> <item id="image206" href="images/img06.jpg" media-type="image/jpeg"/> <item id="image207" href="images/img07.jpg" media-type="image/jpeg"/> <item id="image208" href="images/img08.jpg" media-type="image/jpeg"/> <item id="iBcover" href="images/bcover.jpg" media-type="image/jpeg"/> <item id="css" href="stylesheet.css" media-type="text/css"/> <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/> </manifest>
The spine is an ordered list of all of the contents of the book. It uses the item IDs you created in the manifest. Each item gets an item ref, and use the item id that you created in the manifest for the id ref.
Match the item's id in the spine for every item in the manifest section using the editor, save the changes and close the file.
<spine toc="ncx"> <itemref idref="Cover"/> <itemref idref="nav"/> <itemref idref="ch01"/> <itemref idref="Bcover"/> </spine>
To make changes to the chapter content:
- Navigate to .../Book_X/Guide Package/Book_X/EPUB/ch01.xhtml
- Open ch01.xhtml file with the editor.
- Rename the chapter title within the <title></title> tags found at the top.
- Transcribe the texts into the chapter's <p></p> tags, replacing the content with that available in the book to be made
Adding a chapter
- Create a new HTML file anywhere, preferably beside the other XHTML files. To avoid basic errors, it’s better to copy one of the existing chapters and modify it as needed.
- Inside the package file, under the manifest list, add a new item similar to any of the other existing chapters in the list (the order does not matter). Enter the new path of the chapter into the href attribute. The path must be relative to the package file. Also, enter a unique ID to the id property.
- Under the spine list, add a new item as such: <itemref idref=”YOUR_UNIQUE_ID”/>. Here order does matter. So make sure you’ve placed it before and after the appropriate items.
Removing a chapter
- Find the chapter that you want to remove. Finding it will require you to open them one by one, as the package file does not describe the content. But the order in the spine should give you a hint. If the chapter is one of the last chapters, then look near the bottom of the spine list. You get the point.
- Remove: the document file, the spine item, and the manifest item. Missing any one of these will give you an EPUB validation check error.