Skip to content

Commit

Permalink
v0.31
Browse files Browse the repository at this point in the history
Minor bug fixes, primarily when a chapter is on page 0/cover
  • Loading branch information
verdecillion committed Sep 24, 2024
1 parent c20811a commit 20a09aa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions imgs_2_epub.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

### PREP

debug = False
debug = True

settings={}

Expand Down Expand Up @@ -158,7 +158,10 @@ def promptMeta(tochange, question, good, bad, invalidMsg):
if debug == True: print("CHAPTER: "+chapter)
if chapter != "":
if chapter.isdigit():
settings["chapters"].append(chapter)
if chapter == "0":
settings["chapters"].append("cover")
else:
settings["chapters"].append("pg_"+chapter)
else:
print("\nNot a page!")
else: break
Expand Down Expand Up @@ -361,7 +364,7 @@ def create_file(path, write):
create_file(os.path.join(settings["epub_path"], settings["filename"],"OEBPS","stylesheet.css"), stylesheet)

## NAVIGATION DOCUMENT (NAV.XHTML)
for i in range(len(settings["chapters"])): navigation += f"\n <li>\n <a href=\"pg_{settings['chapters'][i]}.xhtml\">{settings['chapterNames'][i]}</a>\n </li>\n"
for i in range(len(settings["chapters"])): navigation += f"\n <li>\n <a href=\"{settings['chapters'][i]}.xhtml\">{settings['chapterNames'][i]}</a>\n </li>\n"

navigation += "\n </ol>\n </nav>\n <nav xmlns:epub=\"http://www.idpf.org/2007/ops\" role=\"doc-pagelist\" epub:type=\"page-list\" id=\"page-list\">\n <ol>\n"

Expand Down

0 comments on commit 20a09aa

Please sign in to comment.