story(vol04): 完成69至88章与第四卷阅读包
This commit is contained in:
@@ -222,16 +222,45 @@ def build_novel_edition(chapters, destination, title, scope, edition_date):
|
||||
parts.append('# 第二卷 黑腹热')
|
||||
elif path.name.startswith('49_'):
|
||||
parts.append('# 第三卷 无神罚的异端')
|
||||
elif path.name.startswith('69_'):
|
||||
parts.append('# 第四卷 无证人的长路')
|
||||
parts.append(re.sub(r'^(#+) ', r'\1# ', source, flags=re.M).rstrip())
|
||||
write(destination, '\n\n'.join(parts) + '\n')
|
||||
return count
|
||||
|
||||
|
||||
def build_four_volume_editions(edition_date):
|
||||
"""只汇集小说,不改动漫源稿、配音表或此前范围固定的阅读本。"""
|
||||
chapters = []
|
||||
for volume in ('第一卷', '第二卷', '第三卷', '第四卷'):
|
||||
chapters.extend(sorted((NOVEL / '03_正文' / volume).glob('[0-9][0-9]_*.md')))
|
||||
if [int(p.name[:2]) for p in chapters] != list(range(89)):
|
||||
raise ValueError('四卷应为序章00和正文01—88,无缺号或重复')
|
||||
fourth = [p for p in chapters if 69 <= int(p.name[:2]) <= 88]
|
||||
combined = NOVEL / '前88章_阅读合订本.md'
|
||||
fourth_out = NOVEL / '第四卷_无证人的长路_阅读合订本.md'
|
||||
full_count = build_novel_edition(chapters, combined,
|
||||
'《寂静诸神:炉火》前四卷阅读合订本',
|
||||
'独立序章+正文1—88章;前两卷各24章,第三、四卷各20章完整初稿', edition_date)
|
||||
fourth_count = build_novel_edition(fourth, fourth_out,
|
||||
'第四卷《无证人的长路》阅读合订本',
|
||||
'总第69—88章,共20章;873春末—874初秋,埃利安18→19岁', edition_date)
|
||||
print(f'小说88章+序章;约{full_count:,}汉字;第四卷20章约{fourth_count:,}汉字(含标题)')
|
||||
print(combined)
|
||||
print(fourth_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='只汇集当前前四卷阅读本,不更新影像剧本与录制资料')
|
||||
args = parser.parse_args()
|
||||
if args.novel_only:
|
||||
if args.refresh_reading:
|
||||
parser.error('--novel-only不能与--refresh-reading同时使用')
|
||||
build_four_volume_editions(args.date)
|
||||
return
|
||||
global_path = EPISODES / '全季_台词与录制总表.tsv'
|
||||
global_fields, global_rows = read_table(global_path)
|
||||
previous_global = {row['台词ID']: row for row in global_rows}
|
||||
@@ -316,7 +345,9 @@ def main():
|
||||
source = rebase_markdown(read(path), path, script_out)
|
||||
parts.extend(['\n---\n', re.sub(r'^(#+) ', r'\1# ', source, flags=re.M).rstrip()])
|
||||
write(script_out, '\n\n'.join(parts) + '\n')
|
||||
print(f'正文:68章+序章;汉字约{novel_cjk:,};第三卷20章约{volume_cjk:,}汉字(含标题及原有稿次说明)')
|
||||
print(f'前三卷固定范围:68章+序章;汉字约{novel_cjk:,};第三卷20章约{volume_cjk:,}汉字(含标题及原有稿次说明)')
|
||||
if (NOVEL / '03_正文/第四卷/88_只到中立站.md').is_file():
|
||||
build_four_volume_editions(args.date)
|
||||
print(f'EP02—12录制台词:{len(all_rows)};各集:{episode_counts}')
|
||||
print('已核对11集Fountain与阅读稿台词逐条一致。')
|
||||
print(full_out)
|
||||
|
||||
Reference in New Issue
Block a user