| 2525 | |
| 2526 | |
| 2527 | def fmt_section(sec: dict): |
| 2528 | print(f"路径: {sec['path']}") |
| 2529 | print(f"标题: {sec['title']} [^{sec['anchor']}] (level {sec['level']}, line {sec['line']})") |
| 2530 | print(f"字符范围: {sec['char_start']}-{sec['char_end']} ({sec['char_end']-sec['char_start']} 字符)") |
| 2531 | if sec.get("agent_summary"): |
| 2532 | print(f"摘要(LLM): {sec['agent_summary']}") |
| 2533 | elif sec.get("preview"): |
| 2534 | print(f"预览: {sec['preview']}") |
| 2535 | print() |
| 2536 | print("-" * 60) |
| 2537 | print(sec["content"]) |
| 2538 | |
| 2539 | |
| 2540 | def fmt_block(blk: dict): |