<?xml version=“1.0” encoding=“utf-8” standalone=“yes”?> <package xmlns=“www.idpf.org/2007/opf” unique-identifier=“bookid” version=“2.0” xmlns:dc=“purl.org/dc/elements/1.1/”>

<metadata xmlns:opf="http://www.idpf.org/2007/opf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <!-- ISBN -->
  {% if book.isbn %}
    <dc:identifier id="bookid" opf:scheme="ISBN">urn:isbn:{{ book.isbn }}</dc:identifier>
  {% endif %}
  <dc:title>{{ book.title }}</dc:title>
  <dc:rights>Copyright © [YEAR] {{ book.author }}. All rights reserved.</dc:rights>

  <!-- BISAC Subject Headings List: http://www.bisg.org/what-we-do-0-136-bisac-subject-headings-list-major-subjects.php-->
  <dc:subject>{{ book.subjects }}</dc:subject>

  <dc:creator opf:file-as="{{ book.author }}" opf:role="aut">{{ book.author }}</dc:creator>

  <dc:source>{{ book.url }}</dc:source>

  <!-- List of contributors

       See: MARC Code List for Relators: http://www.loc.gov/marc/relators/relaterm.html

       Examples: 

       * Editor [edt]
         Use for a person or organization who prepares for publication a work not primarily his/her own,
         such as by elucidating text, adding introductory or other critical matter, or technically directing
         an editorial staff.

       * Cover designer [cov]
         Use for a person or organization responsible for the graphic design of a book cover,
         album cover, slipcase, box, container, etc. For a person or organization responsible 
         for the graphic design of an entire book, use Book designer; for book jackets, use Bookjacket designer.

       * Translator [trl]
         Use for a person or organization who renders a text from one language into another, or from an older 
         form of a language into the modern form.

       -->

  <!--
  <dc:contributor opf:file-as="[LASTNAME, NAME]" opf:role="edt">[NAME LASTNAME]</dc:contributor>
  <dc:contributor opf:file-as="[LASTNAME, NAME]" opf:role="cov">[NAME LASTNAME]</dc:contributor>
  -->

  <dc:publisher>{{ book.publisher }}</dc:publisher>
  <dc:date opf:event="publication">2012-01-01</dc:date>

  <!-- Language code: http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes -->
  <dc:language>{{ book.language }}</dc:language>

  <meta name="cover" content="{{ book.cover.filename }}" />

  <!-- UUID generator: http://www.famkruithof.net/uuid/uuidgen -->
  <dc:identifier opf:scheme="UUID">urn:uuid:{{ book.uuid }}</dc:identifier>

</metadata>

<!-- MANIFEST (mandatory)
     List of all the resources of the book (XHTML, CSS, images,…).
     The order of item elements in the manifest is NOT significant.

     http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.3 
-->

<manifest>
  {% if book.cover %}
    <item href="Images/{{ book.cover.filename }}" id="{{ book.cover.filename }}" media-type="{{ book.cover.file_mime }}" />
    <item href="Text/cover.xhtml" id="cover" media-type="application/xhtml+xml" />
  {% endif %}
  <item href="toc.ncx" id="ncx" media-type="application/x-dtbncx+xml" />
  <item href="Styles/style.css" id="css" media-type="text/css" />
  <!--
  <item href="Text/frontmatter.xhtml" id="frontmatter" media-type="application/xhtml+xml" />
  <item href="Text/dedication.xhtml" id="dedication" media-type="application/xhtml+xml" />
  -->
  <item href="Text/toc.xhtml" id="toc" media-type="application/xhtml+xml" />
  <!--
  <item href="Text/foreword.xhtml" id="foreword" media-type="application/xhtml+xml" />
  -->
  {% if book.introduction %}
    <item href="Text/introduction.xhtml" id="introduction" media-type="application/xhtml+xml" />
  {% endif %}

  {% for chapter in book.chapters %}
    <item href="Text/chapter{{ chapter.id }}.xhtml" id="chapter-{{ chapter.id }}" media-type="application/xhtml+xml" />
  {% endfor %}

  {% if book.endnotes %}
    <item href="Text/endnotes.xhtml" id="endnotes" media-type="application/xhtml+xml" />
  {% endif %}
  <!--
  <item href="Text/acknowledgements.xhtml" id="acknowledgements" media-type="application/xhtml+xml" />
  <item href="Images/image-01.jpg" id="image-01" media-type="image/jpeg" />
  <item href="Images/image-02.png" id="image-02" media-type="image/png" />
  -->
</manifest>

<!-- SPINE (mandatory)

     The spine element defines the default reading order of the content. It doesn't list every file in the manifest, 
     just the reading order.

     The value of the idref tag in the spine has to match the ID tag for that entry in the manifest.

     For example, if you have the following reference in your manifest:

        <item id="chapter-1" href="chapter01.xhtml" media-type="application/xhtml+xml" />

     your spine entry would be:

        <itemref idref="chapter-1" />

     http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.4

     -->
<spine toc="ncx">
  {% if book.cover %}
    <itemref idref="cover" />
  {% endif %}
  <!--
  <itemref idref="frontmatter" />
  -->
  <itemref idref="toc" />
  <!--
  <itemref idref="foreword" />
  <itemref idref="dedication" />
  -->
  {% if book.introduction %}
    <itemref idref="introduction" />
  {% endif %}

  {% for chapter in book.chapters %}
    <itemref idref="chapter-{{ chapter.id }}" />
  {% endfor %}

  {% if book.endnotes %}
    <itemref idref="endnotes" />
  {% endif %}
  <!--
  <itemref idref="acknowledgements" />
  -->
</spine>

<!-- GUIDE (optional, recommended by Apple)

      The guide lets you specify the role of the book's files.

      Available tags: cover, title-page, toc, index, glossary, acknowledgements, bibliography,
      colophon, copyright-page, dedication, epigraph, foreword, loi (list of illustrations),
      lot (list of tables), notes, preface, and text.

      http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.6

     -->
<guide>
  {% if book.cover %}
    <reference href="Text/cover.xhtml" title="Cover" type="cover" />
  {% endif %}
  <reference href="Text/toc.xhtml" title="Table of Contents" type="toc" />
  <!--
  <reference href="Text/frontmatter.xhtml" type="copyright-page" />
  <reference href="Text/foreword.xhtml" type="foreword" />
  <reference href="Text/dedication.xhtml" type="dedication" />
  -->
  {% if book.introduction %}
    <reference href="Text/introduction.xhtml" type="text" />
  {% endif %}

  {% for chapter in book.chapters %}
    <reference href="Text/chapter{{ chapter.id }}.xhtml" type="text" />
  {% endfor %}

  {% if book.endnotes %}
    <reference href="Text/endnotes.xhtml" type="notes" />
  {% endif %}
  <!--
  <reference href="Text/acknowledgements.xhtml" type="acknowledgements" />
  -->
</guide>

</package>