aboutsummaryrefslogtreecommitdiff
path: root/source/epub/templates/content.opf
blob: 67f3f5c637c1d54ad510e1bf80d9f5a5b8a6540b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<opf:package xmlns:opf="http://www.idpf.org/2007/opf"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:py="http://genshi.edgewall.org/"
    unique-identifier="bookid" version="2.0">
  <opf:metadata >
    <dc:identifier id="bookid">urn:uuid:${book.UUID}</dc:identifier>
    <dc:language>${book.lang}</dc:language>
    <dc:title>${book.title}</dc:title>
    <py:for each="name, role in book.creators">
    <dc:creator opf:role="$role">$name</dc:creator>
    </py:for>
    <py:for each="beginTag, content, endTag in book.getMetaTags()">
    ${Markup(beginTag)}$content${Markup(endTag)}
    </py:for>
    <opf:meta name="cover" content="${book.coverImage.id}" py:if="book.coverImage"/>
  </opf:metadata>
  <opf:manifest>
    <opf:item id="ncxtoc" media-type="application/x-dtbncx+xml" href="toc.ncx"/>
    <py:for each="item in book.getAllItems()">
    <opf:item id="${item.id}" media-type="${item.mimeType}" href="${item.destPath}"/>
    </py:for>
  </opf:manifest>
  <opf:spine toc="ncxtoc">
    <py:for each="_, item, linear in book.getSpine()">
    <opf:itemref idref="${item.id}" linear="${'yes' if linear else 'no'}"/>
    </py:for>
  </opf:spine>
  <opf:guide py:if="book.guide">
    <py:for each="href, title, type in book.getGuide()">
    <opf:reference href="$href" type="$type" title="$title"/>
    </py:for>
  </opf:guide>
</opf:package>
bgstack15