Skip to content

Commit

Permalink
should polish this soon, but it is working well for rush now
Browse files Browse the repository at this point in the history
  • Loading branch information
interrogator committed Dec 12, 2019
1 parent 8df869a commit 10bbe5c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/epub.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def convert(epub, metafile=None):
part_number = 0
part_paths = []

not_chapters = {"copyright", "cover", "contents", "editor's note", "editors' note", "editor’s note", title.lower()}
not_chapters = {"copyright", "cover", "cover-page", "contents", "editor's note", "editors' note", "editor’s note", title.lower()}

is_part = {"epub3_p", "epub_p"}
is_chapter = {"epub_c", "epub3_c", "-h-", "index_split_"}
Expand Down Expand Up @@ -241,6 +241,18 @@ def convert(epub, metafile=None):
chapter_number += 1
numfilled = str(chapter_number).zfill(3)
safe_name = make_safe_name(chapter_name)
if safe_name in {
"cover-page",
"other-books-by-this-author",
"title-page",
"dedication",
"about",
"map",
"epigraph",
"acknowledgements",
"about-the-author"
}:
continue
meta.update(dict(chapter_name=chapter_name, chapter_number=chapter_number))
meta_string = make_meta_element(meta)
chapter_path = f"{numfilled}-{safe_name}"
Expand Down

0 comments on commit 10bbe5c

Please sign in to comment.