MCPcopy
hub / github.com/666ghj/BettaFish / stitch_document

Function stitch_document

regenerate_latest_html.py:128–149  ·  view source on GitHub ↗

将各章节与元数据装订为完整的 Document IR。 使用 DocumentComposer 统一处理章节顺序、全局元数据等,并打印 装订完成的章节与图表数量。 参数: report_id: 报告 ID(来自 manifest 或目录名) metadata: manifest 中的全局元数据 chapters: 已加载的章节列表 返回: dict: 完整的 Document IR 对象

(report_id, metadata, chapters)

Source from the content-addressed store, hash-verified

126
127
128def stitch_document(report_id, metadata, chapters):
129 """
130 将各章节与元数据装订为完整的 Document IR。
131
132 使用 DocumentComposer 统一处理章节顺序、全局元数据等,并打印
133 装订完成的章节与图表数量。
134
135 参数:
136 report_id: 报告 ID(来自 manifest 或目录名)
137 metadata: manifest 中的全局元数据
138 chapters: 已加载的章节列表
139
140 返回:
141 dict: 完整的 Document IR 对象
142 """
143 composer = DocumentComposer()
144 document_ir = composer.build_document(report_id, metadata, chapters)
145 logger.info(
146 f"装订完成: {len(document_ir.get('chapters', []))} 个章节,"
147 f"{count_charts(document_ir)} 个图表"
148 )
149 return document_ir
150
151
152def count_charts(document_ir):

Callers 1

mainFunction · 0.70

Calls 4

build_documentMethod · 0.95
DocumentComposerClass · 0.90
count_chartsFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected