story(vol05): 完成89至112章与第五卷阅读包

This commit is contained in:
2026-11-01 14:08:44 +08:00
parent a442897755
commit b71fb8dd45
51 changed files with 10502 additions and 47 deletions
+33 -2
View File
@@ -224,6 +224,8 @@ def build_novel_edition(chapters, destination, title, scope, edition_date):
parts.append('# 第三卷 无神罚的异端')
elif path.name.startswith('69_'):
parts.append('# 第四卷 无证人的长路')
elif path.name.startswith('89_'):
parts.append('# 第五卷 越过边境')
parts.append(re.sub(r'^(#+) ', r'\1# ', source, flags=re.M).rstrip())
write(destination, '\n\n'.join(parts) + '\n')
return count
@@ -250,16 +252,43 @@ def build_four_volume_editions(edition_date):
print(fourth_out)
def build_five_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(113)):
raise ValueError('五卷应为序章00和正文01—112,无缺号或重复')
fifth = [p for p in chapters if 89 <= int(p.name.split('_', 1)[0]) <= 112]
combined = NOVEL / '前112章_阅读合订本.md'
fifth_out = NOVEL / '第五卷_越过边境_阅读合订本.md'
full_count = build_novel_edition(chapters, combined,
'《寂静诸神:炉火》前五卷阅读合订本',
'独立序章+正文1—112章;第一、二、五卷各24章,第三、四卷各20章完整初稿', edition_date)
fifth_count = build_novel_edition(fifth, fifth_out,
'第五卷《越过边境》阅读合订本',
'总第89—112章,共24章;874初秋—晚秋,埃利安19岁', edition_date)
print(f'小说112章+序章;约{full_count:,}汉字;第五卷24章约{fifth_count:,}汉字(含标题)')
print(combined)
print(fifth_out)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--date', required=True)
parser.add_argument('--refresh-reading', help='由Fountain重建指定分集阅读稿,如S01E04;同时更新该集前置动作提示')
parser.add_argument('--novel-only', action='store_true', help='只汇集当前前四卷阅读本,不更新影像剧本与录制资料')
parser.add_argument('--novel-only', action='store_true', help='只汇集当前小说阅读本,不更新历史范围或影像资料')
args = parser.parse_args()
if args.novel_only:
if args.refresh_reading:
parser.error('--novel-only不能与--refresh-reading同时使用')
build_four_volume_editions(args.date)
if (NOVEL / '03_正文/第五卷/112_明天要见的人.md').is_file():
build_five_volume_editions(args.date)
else:
build_four_volume_editions(args.date)
return
global_path = EPISODES / '全季_台词与录制总表.tsv'
global_fields, global_rows = read_table(global_path)
@@ -348,6 +377,8 @@ def main():
print(f'前三卷固定范围:68章+序章;汉字约{novel_cjk:,};第三卷20章约{volume_cjk:,}汉字(含标题及原有稿次说明)')
if (NOVEL / '03_正文/第四卷/88_只到中立站.md').is_file():
build_four_volume_editions(args.date)
if (NOVEL / '03_正文/第五卷/112_明天要见的人.md').is_file():
build_five_volume_editions(args.date)
print(f'EP02—12录制台词:{len(all_rows)};各集:{episode_counts}')
print('已核对11集Fountain与阅读稿台词逐条一致。')
print(full_out)