|
|
@@ -136,6 +136,7 @@ def _prepare_data_sources(raw_sources: Optional[List[Dict]], config_root: Path)
|
|
|
}
|
|
|
prepared_source["json_pattern"] = _render_template(src.get("json_pattern"), ctx)
|
|
|
prepared_source["image_pattern"] = _render_template(src.get("image_pattern"), ctx)
|
|
|
+ prepared_source["description"] = _render_template(src.get("description"), ctx)
|
|
|
|
|
|
if "output" in src:
|
|
|
output_cfg = dict(src["output"])
|
|
|
@@ -274,26 +275,3 @@ def load_structure_from_config(config_path: Path) -> dict:
|
|
|
|
|
|
return structure
|
|
|
|
|
|
-
|
|
|
-# def save_structure_to_config(structure: dict, output_path: Path):
|
|
|
-# """
|
|
|
-# 保存表格结构到配置文件
|
|
|
-
|
|
|
-# Args:
|
|
|
-# structure: 表格结构字典
|
|
|
-# output_path: 输出文件路径
|
|
|
-# """
|
|
|
-# save_data = {
|
|
|
-# 'rows': structure['rows'],
|
|
|
-# 'columns': structure['columns'],
|
|
|
-# 'horizontal_lines': structure.get('horizontal_lines', []),
|
|
|
-# 'vertical_lines': structure.get('vertical_lines', []),
|
|
|
-# 'row_height': structure['row_height'],
|
|
|
-# 'col_widths': structure['col_widths'],
|
|
|
-# 'table_bbox': structure['table_bbox'],
|
|
|
-# 'modified_h_lines': list(structure.get('modified_h_lines', set())),
|
|
|
-# 'modified_v_lines': list(structure.get('modified_v_lines', set()))
|
|
|
-# }
|
|
|
-
|
|
|
-# with open(output_path, 'w', encoding='utf-8') as f:
|
|
|
-# json.dump(save_data, f, indent=2, ensure_ascii=False)
|