Book 2 published
This commit is contained in:
@@ -173,7 +173,7 @@ def is_stub(text: str) -> bool:
|
||||
content = re.sub(r"^#+\s+.*$", "", text, flags=re.MULTILINE)
|
||||
content = re.sub(r"<!--.*?-->", "", content, flags=re.DOTALL)
|
||||
content = content.strip()
|
||||
return len(content.split()) < 50
|
||||
return len(content.split()) < 10
|
||||
|
||||
|
||||
def load_template(path: Path) -> str | None:
|
||||
@@ -281,9 +281,11 @@ def build_epub(args) -> Path:
|
||||
front_md = load_template(template_dir / "front-matter.md")
|
||||
if front_md:
|
||||
html = convert_md_to_html(front_md)
|
||||
ch = make_epub_chapter("front-matter.xhtml", "Front Matter", html)
|
||||
front_title = extract_title(front_md) or "Front Matter"
|
||||
ch = make_epub_chapter("front-matter.xhtml", front_title, html)
|
||||
book.add_item(ch)
|
||||
spine.append(ch)
|
||||
toc.append(ch)
|
||||
|
||||
# --- Chapters ---
|
||||
chapters = discover_chapters(chapter_dir)
|
||||
@@ -344,6 +346,9 @@ def generate_checklist(book_num: int, epub_path: Path) -> Path:
|
||||
notes_dir.mkdir(parents=True, exist_ok=True)
|
||||
checklist_path = notes_dir / f"book{book_num}-kindle-publish-checklist.md"
|
||||
|
||||
if checklist_path.exists():
|
||||
return checklist_path
|
||||
|
||||
checklist = f"""\
|
||||
# Kindle Publishing Checklist — Book {book_num}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user