Tweak output a bit, allow any 'entry' as epub subject.

This commit is contained in:
Jim Miller
2011-05-06 12:42:20 -05:00
parent 0e28d86a7b
commit 9515ff00be
4 changed files with 11 additions and 13 deletions
+4 -4
View File
@@ -28,7 +28,7 @@
# formatext
## items to include in title page
titlepage_entries: category,genre,status,datePublished,dateUpdated,dateCreated,rating,warnings,numChapters,numWords,site,storyId,authorId,extratags,description
titlepage_entries: category,genre,status,datePublished,dateUpdated,dateCreated,rating,warnings,numChapters,numWords,site,description
## include title page as first page.
include_titlepage: true
@@ -73,10 +73,10 @@ windows_eol: true
## epub is already a zip file.
zip_output: false
# possible subject tags: extratags, genre, category, warnings, lastupdate
# entries tags to make epub subject tags
# lastupdate creates two tags: "Last Update Year/Month: %Y/%m" and "Last Update: %Y/%m/%d"
include_subject_tags: extratags, genre, category, lastupdate
include_tocpage: false
include_subject_tags: extratags, genre, category, lastupdate, status
#include_tocpage: false
# epub->mobi conversions typically don't like tables.
titlepage_use_table: true
-4
View File
@@ -81,10 +81,6 @@ def main():
outputepub = ZipFile(outputopt, "w", compression=ZIP_STORED)
outputepub.debug = 3
outputepub.writestr("mimetype", "application/epub+zip")
# declares all the files created by Windows. otherwise, when
# it runs in appengine, windows unzips the files as 000 perms.
for zf in outputepub.filelist:
zf.create_system = 0
outputepub.close()
## Re-open file for content.
+6 -4
View File
@@ -80,7 +80,7 @@ h6 { text-align: center; }
<link href="stylesheet.css" type="text/css" charset="UTF-8" rel="stylesheet"/>
</head>
<body>
<h1><a href="${storyUrl}">${title}</a> by <a href="${authorUrl}">${author}</a></h1>
<h3><a href="${storyUrl}">${title}</a> by <a href="${authorUrl}">${author}</a></h3>
<table class="full">
''')
@@ -240,8 +240,11 @@ h6 { text-align: center; }
metadata.appendChild(newTag(contentdom,"dc:description",text=
self.getMetadata('description')))
metadata.appendChild(newTag(contentdom,"dc:subject",text=
self.getMetadata('status')))
for entry in self.titleLabels.keys():
if entry in self.getConfigList("include_subject_tags") and \
self.story.getMetadata(entry):
metadata.appendChild(newTag(contentdom,"dc:subject",text=
self.getMetadata(entry)))
# listables all go into dc:suject tags, but only if they are configured.
for (name,lst) in self.story.getLists().iteritems():
if name in self.getConfigList("include_subject_tags"):
@@ -394,7 +397,6 @@ h6 { text-align: center; }
# declares all the files created by Windows. otherwise, when
# it runs in appengine, windows unzips the files as 000 perms.
logging.debug("outputepub create_system")
for zf in outputepub.filelist:
zf.create_system = 0
outputepub.close()
+1 -1
View File
@@ -25,7 +25,7 @@ class HTMLWriter(BaseStoryWriter):
<title>${title} by ${author}</title>
</head>
<body>
<h1><a href="${storyUrl}">${title}</a> by <a href="${authorUrl}">${author}</a></h1>
<h3><a href="${storyUrl}">${title}</a> by <a href="${authorUrl}">${author}</a></h3>
''')
self.HTML_TITLE_PAGE_START = string.Template('''