~ubuntu-branches/ubuntu/oneiric/calibre/oneiric

« back to all changes in this revision

Viewing changes to resources/templates/ncx.xml

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2010-06-21 10:18:08 UTC
  • mfrom: (1.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20100621101808-aue828f532tmo4zt
Tags: 0.7.2+dfsg-1
* New major upstream version. See http://calibre-ebook.com/new-in/seven for
  details.
* Refresh patches to apply cleanly.
* debian/control: Bump python-cssutils to >= 0.9.7~ to ensure the existence
  of the CSSRuleList.rulesOfType attribute. This makes epub conversion work
  again. (Closes: #584756)
* Add debian/local/calibre-mount-helper: Simple and safe replacement for
  upstream's calibre-mount-helper, using udisks --mount and eject.
  (Closes: #584915, LP: #561958)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0"  encoding="UTF-8"?>
2
 
<?python
3
 
from uuid import uuid4
4
 
import re
5
 
?>
6
 
<ncx version="2005-1" 
7
 
     xml:lang="en" 
8
 
     xmlns="http://www.daisy.org/z3986/2005/ncx/"
9
 
     xmlns:py="http://genshi.edgewall.org/"
10
 
     xmlns:calibre="http://calibre.kovidgoyal.net/2009/metadata"
11
 
>
12
 
    <head>
13
 
        <meta name="dtb:uid" content="${uid}"/>
14
 
        <meta name="dtb:depth" content="${toc.depth()}"/>
15
 
        <meta name="dtb:generator" content="${__appname__}"/>
16
 
        <meta name="dtb:totalPageCount" content="0"/>
17
 
        <meta name="dtb:maxPageNumber" content="0"/>
18
 
    </head>
19
 
    <docTitle><text>Table of Contents</text></docTitle>
20
 
    
21
 
    <py:def function="navpoint(np, level)">
22
 
        ${'%*s'%(4*level,'')}<navPoint id="${str(uuid4())}" playOrder="${str(np.play_order)}">
23
 
            ${'%*s'%(4*level,'')}<navLabel>
24
 
                ${'%*s'%(4*level,'')}<text>${re.sub(r'\s+', ' ', np.text)}</text>
25
 
            ${'%*s'%(4*level,'')}</navLabel>
26
 
            ${'%*s'%(4*level,'')}<content src="${unicode(np.href)+(('#' + unicode(np.fragment)) if np.fragment else '')}" />
27
 
            ${'%*s'%(4*level,'')}<calibre:meta py:if="np.author" name="author">${np.author}</calibre:meta>
28
 
            ${'%*s'%(4*level,'')}<calibre:meta py:if="np.description" name="description">${np.description}</calibre:meta>
29
 
            <py:for each="np2 in np">${navpoint(np2, level+1)}</py:for>
30
 
        ${'%*s'%(4*level,'')}</navPoint>
31
 
    </py:def>
32
 
    <navMap>
33
 
    <py:for each="np in toc">${navpoint(np, 0)}</py:for>
34
 
    </navMap>
35
 
</ncx>