Final changes and update
This commit is contained in:
@@ -18,7 +18,7 @@ def compile_files(bp, ms, folder):
|
||||
if meta.get('filename'):
|
||||
safe = meta['filename']
|
||||
else:
|
||||
safe = "".join([c for c in title if c.isalnum() or c=='_']).replace(" ", "_")
|
||||
safe = utils.sanitize_filename(title)
|
||||
|
||||
doc = Document(); doc.add_heading(title, 0)
|
||||
book = epub.EpubBook(); book.set_title(title); spine = ['nav']
|
||||
@@ -29,6 +29,9 @@ def compile_files(bp, ms, folder):
|
||||
with open(cover_path, 'rb') as f:
|
||||
book.set_cover("cover.png", f.read())
|
||||
|
||||
# Ensure manuscript is sorted correctly before compiling
|
||||
ms.sort(key=utils.chapter_sort_key)
|
||||
|
||||
for c in ms:
|
||||
# Determine filename/type
|
||||
num_str = str(c['num']).lower()
|
||||
|
||||
Reference in New Issue
Block a user