Final changes and update

This commit is contained in:
2026-02-04 20:19:07 -05:00
parent 6e7ff0ae1d
commit 9f8f094564
21 changed files with 1816 additions and 645 deletions

View File

@@ -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()