Skip to content

feat(export): add missing chapter placeholder rendering - #151

Merged
saudadez21 merged 1 commit into
mainfrom
feat/render-missing-chapter
Nov 26, 2025
Merged

feat(export): add missing chapter placeholder rendering#151
saudadez21 merged 1 commit into
mainfrom
feat/render-missing-chapter

Conversation

@saudadez21

Copy link
Copy Markdown
Owner

Description

This PR introduces a new configuration option render_missing_chapter and adds unified “missing chapter placeholder” support across TXT, EPUB, and HTML exporters.

When a chapter is missing (e.g., inaccessible, unsubscribed, or not downloaded), and render_missing_chapter = true, exporters now insert a placeholder section instead of silently skipping the chapter.

This improves readability, prevents unnoticed gaps, and provides a consistent experience across formats.


Changes

  • Added new config flag:
    render_missing_chapter: bool = true controls whether missing chapters should render a placeholder during export.
  • Implemented _xp_epub_missing_chapter() helper and integrated the logic into:
    • _export_volume_epub
    • _export_book_epub
  • Implemented _xp_html_missing_chapter() helper and integrated into:
    • _export_book_html
  • Implemented _xp_txt_missing_chapter() helper and integrated into:
    • _export_book_txt
  • Ensured all formats use a consistent placeholder structure:
    • Title line
    • "本章内容暂不可用" fallback text
  • Updated export pipelines to correctly handle missing chapters instead of skipping them silently.

Motivation

Previously, missing or inaccessible chapters were silently omitted during export.

For long novels or novels with many paid chapters, this often resulted in:

  • unnoticed chapter gaps
  • inconsistent reading experience
  • difficulty identifying missing content

By adding explicit placeholder rendering, users can immediately see where chapters are unavailable, making the exported files more complete and easier to navigate.


Related Issues

Fixes #148


Type of change

  • New feature (non-breaking change which adds functionality)

@saudadez21
saudadez21 merged commit 84fc6d7 into main Nov 26, 2025
1 check passed
@saudadez21
saudadez21 deleted the feat/render-missing-chapter branch November 26, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 支持在导出时为未订阅章节插入占位模板

1 participant