From 365c28bfdb51355c3ff9f2f59cbd4f77bb5348fc Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 29 Aug 2019 16:34:54 -0700 Subject: [PATCH] Add more formatters into NCX_TEMPLATE, NAV_TEMPLATE. --- epubfile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/epubfile.py b/epubfile.py index ae88760..1451f8a 100644 --- a/epubfile.py +++ b/epubfile.py @@ -88,9 +88,10 @@ NCX_TEMPLATE = ''' - Unknown + {title} +{navpoints} '''.strip() @@ -105,8 +106,7 @@ NAV_XHTML_TEMPLATE = ''' @@ -314,8 +314,8 @@ class Epub: writefile(root.join('mimetype'), MIMETYPE_FILE_TEMPLATE) writefile(root.join('META-INF/container.xml'), CONTAINER_XML_TEMPLATE) writefile(root.join('OEBPS/content.opf'), OPF_TEMPLATE.format(uuid=uid)) - writefile(root.join('OEBPS/toc.ncx'), NCX_TEMPLATE.format(uuid=uid)) - writefile(root.join('OEBPS/Text/nav.xhtml'), NAV_XHTML_TEMPLATE) + writefile(root.join('OEBPS/toc.ncx'), NCX_TEMPLATE.format(uuid=uid, title='Unknown', navpoints='')) + writefile(root.join('OEBPS/Text/nav.xhtml'), NAV_XHTML_TEMPLATE.format(toc_contents='')) return cls(tempdir)