story(vol06): 完成113至136章与第六卷阅读包

This commit is contained in:
2026-11-01 14:54:55 +08:00
parent b71fb8dd45
commit f74f8f4e33
54 changed files with 11187 additions and 43 deletions
+31 -1
View File
@@ -226,6 +226,8 @@ def build_novel_edition(chapters, destination, title, scope, edition_date):
parts.append('# 第四卷 无证人的长路')
elif path.name.startswith('89_'):
parts.append('# 第五卷 越过边境')
elif path.name.startswith('113_'):
parts.append('# 第六卷 紫发魔王')
parts.append(re.sub(r'^(#+) ', r'\1# ', source, flags=re.M).rstrip())
write(destination, '\n\n'.join(parts) + '\n')
return count
@@ -276,6 +278,30 @@ def build_five_volume_editions(edition_date):
print(fifth_out)
def build_six_volume_editions(edition_date):
"""汇集当前六卷;不重写此前范围的阅读本。"""
chapters = []
for volume in ('第一卷', '第二卷', '第三卷', '第四卷', '第五卷', '第六卷'):
paths = (NOVEL / '03_正文' / volume).glob('*.md')
chapters.extend(sorted((p for p in paths if re.match(r'^\d+_', p.name)),
key=lambda p: int(p.name.split('_', 1)[0])))
numbers = [int(p.name.split('_', 1)[0]) for p in chapters]
if numbers != list(range(137)):
raise ValueError('六卷应为序章00和正文01—136,无缺号或重复')
sixth = [p for p in chapters if 113 <= int(p.name.split('_', 1)[0]) <= 136]
combined = NOVEL / '前136章_阅读合订本.md'
sixth_out = NOVEL / '第六卷_紫发魔王_阅读合订本.md'
full_count = build_novel_edition(chapters, combined,
'《寂静诸神:炉火》前六卷阅读合订本',
'独立序章+正文1—136章;第一、二、五、六卷各24章,第三、四卷各20章完整初稿', edition_date)
sixth_count = build_novel_edition(sixth, sixth_out,
'第六卷《紫发魔王》阅读合订本',
'总第113—136章,共24章;874晚秋—875早春,埃利安19→20岁', edition_date)
print(f'小说136章+序章;约{full_count:,}汉字;第六卷24章约{sixth_count:,}汉字(含标题)')
print(combined)
print(sixth_out)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--date', required=True)
@@ -285,7 +311,9 @@ def main():
if args.novel_only:
if args.refresh_reading:
parser.error('--novel-only不能与--refresh-reading同时使用')
if (NOVEL / '03_正文/第五卷/112_明天要见的人.md').is_file():
if (NOVEL / '03_正文/第六卷/136_春水进渠之前.md').is_file():
build_six_volume_editions(args.date)
elif (NOVEL / '03_正文/第五卷/112_明天要见的人.md').is_file():
build_five_volume_editions(args.date)
else:
build_four_volume_editions(args.date)
@@ -379,6 +407,8 @@ def main():
build_four_volume_editions(args.date)
if (NOVEL / '03_正文/第五卷/112_明天要见的人.md').is_file():
build_five_volume_editions(args.date)
if (NOVEL / '03_正文/第六卷/136_春水进渠之前.md').is_file():
build_six_volume_editions(args.date)
print(f'EP02—12录制台词:{len(all_rows)};各集:{episode_counts}')
print('已核对11集Fountain与阅读稿台词逐条一致。')
print(full_out)