Commits

Brian Mearns committed 1606a18

Fixed bugs in the generation of the file list.

Comments (0)

Files changed (2)

src/tome/res/epub-template/chapter.xhtml.tmpl

         <link rel="contents" href="toc.xhtml" />
         <link rel="start" href="frontcover.xhtml" />
 
-        {if
-            {$ CHAP-IS-FIRST}
-            "<link rel='prev' href='toc.xhtml' />"
-        }
-        {$ CHAP-REL-PREV-HTML}
-        {$ CHAP-REL-NEXT-HTML}
-        {if
-            {$ CHAP-IS-LAST}
-            "<link rel='next' href='endnotes.xhtml' />"
-        }
+        {$ REL-PREV-HTML}
+        {$ REL-NEXT-HTML}
 
     </head>
     <body class='bodymatter chapter'>

src/tome/writeEpub.py

                 genFiles.append(prtFile)
             for bkIdx in xrange(len(part)):
                 bkNum += 1
-                book = self.__tome[bkIdx]
+                book = part[bkIdx]
                 if book.title() is not None:
                     bkFile = self.bookFileName(bkNum)
                     bkFiles.append(bkFile)
                     chFiles.append(chFile)
                     genFiles.append(chFile)
         self.__fileList = genFiles
+
+
         self.__fileIdx = 0
-
-
         for prtIdx in xrange(len(self.__tome)):
             self.__prtNum += 1
             self.generatePart(templStack, self.__tome[prtIdx], prtIdx, len(self.__tome))
             #Explicit, so create the title page.
             self.loadTitledScope(prtScope, "PART", part, prtIdx, parentLength, self.__prtNum)
 
+            self.__fileIdx += 1
+
             #Open the template file.
             try:
                 #TODO: Buffer this once, instead of reading it every time.
             #Explicit, so create the title page.
             self.loadTitledScope(bkScope, "BOOK", book, bkIdx, parentLength, self.__bkNum)
 
+            self.__fileIdx += 1
+
             #Open the template file.
             try:
                 #TODO: Buffer this once, instead of reading it every time.
             #Output the book file.
             self.writeBookFile(self.__bkNum, bkFileContent)
 
+
         #Process all the chapters in this book.
         for chIdx in xrange(len(book)):
             self.__chNum += 1
 
         self.generateChapterContent(chScope, chapter)
 
+        self.__fileIdx += 1
+
         chOstream = cStringIO.StringIO()
         ostream = templ.tstreams.TemplateStreamOutputStream(chOstream)
         templ.templ.processWithStack(istream, ostream, templStack, self.__chapterTemplatePath, debug=False)