Skip to content

omarrr/epub-boilerplate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ePub-Boilerplate

This boilerplate provides a complete template for generating ePub-formatted books. It includes all the standard sections of a book (eg. table of contents, prologue, etc), descriptions of their use and contains examples of ePub features at work (eg. end notes, index, etc)

Fork of https://javierarce.github.com/epub-boilerplate

Book Template

The structure below is included in the boilerplate and it conforms to the standard structure of book design. It is common practice to follow the order described here.

Not all books require every section and in some cases some sections can be merged into one (eg. preface and acknowledgment).

  1. Front matter

    • Cover
    • Title
    • Edition Notice
    • Dedication
    • Table of Contents
    • List of Illustrations
    • List of Tables
    • Foreword
    • Preface
    • Acknowledgements
    • Epigraph
    • Introduction
    • Prologue
  2. Body matter

    • PART I
      • Chapter 1
      • Chapter 2
    • PART II
      • Chapter 3
      • Chapter 4
    • PART III
      • Chapter 5
      • Chapter 6
  3. Back matter

    • Epilogue
    • Afterword
    • Addendum
    • End Notes
    • Glossary
    • Bibliography
    • Index
    • Colophon

How to use it

  1. Get the template:

     $ git clone [email protected]:javierarce/epub-boilerplate.git
    
  2. Edit the contents of the book directory.

  3. Run the publish script to generate and validate the book:

     $ ./publish book.epub
    

Editing the book template

  • File TOC.xhtml

    • Edit meta tag dtb:uid to reflect your unique identifier (uuid, isbn, etc)

        <meta content="urn:isbn:[ISBN]" name="dtb:uid"/>
      
    • Edit the content depth

        <meta content="1" name="dtb:depth"/>
      
    • Edit with the title of the book

        <docTitle>
        	<text>[BOOK'S TITLE]</text>
        </docTitle>
      
    • Describe the structure of your book with navPoint nodes and subnodes.

  • Folder Text-Frontmatter

    • Edit the cover, title, table of content, etc.
    • If needed remove unnecesary sections.
  • Folder Text

    • Create the proper book structure using parts/volumes and chapters.
  • Folder Text-Backmatter

    • Edit the appropiate sections.
    • If needed remove unnecesary sections.
  • File CONTENT.opf

    • Enter the metadata of the book under metadata
    • Enter the full list of files used in the book under manifest
    • Enter the order in which the text files should appear under spine
    • Enter the role of each file type under guide

ePub validation

This project uses epubcheck to validate the generated ePubs. If the build.sh script complains when running epubcheck, make sure you have java installed and it's in your PATH.

If you need help running epubcheck read this step-by-step guide.

Using the check script to validate the book.

$ ./check book.epub

Style

Basic styles have been added to the style.css file to accomodate for standard layouts of the sections included.

For more advanced styles have a look at the ePub CSS Starter Kit.

Useful resources

About

Complete template for generating ePub-formatted books.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%