Files
n8n_Demo/data/订单班文档资料/土木/notion文稿/update_markdown.py
Yep_Q 712dbe3416 refactor: 清理web_result冗余文件夹并修复路径引用
详细说明:
- 删除web_result下的3个冗余文件夹(会展策划/Agent_prompt/agent头像)
- 所有资源已整合到订单班文档资料/文旅目录
- 更新11个文件中的122处路径引用
- 修复wenlu.ts的TypeScript类型声明
- 添加AgentOutput类型导入

影响文件:
- web_result/index.html (30处路径更新)
- web_result/order-classes/wenlu/*.html (62处更新)
- web_result/js/router.js (1处更新)
- exhibition-demo/src/data/terminalSimulations/wenlu.ts (类型修复)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-01 19:11:14 +08:00

51 lines
2.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
# Markdown 文件路径
md_file = "/Users/xiaoqi/Documents/Dev/Project/2025-09-08_n8nDEMO演示/data/订单班文档资料/土木/notion文稿/室内CAD整体方案设计 27d118168b238091993cfd98c7e1f2d9.md"
# 图片映射关系
replacements = [
("image/92fb16c8a0b5731e5ea3ca985ff7eed9.jpeg", "image/室内平面设计图.jpeg"),
("image/af7439ad322b6c64ab2f43e41fc3fcbe.jpeg", "image/实景渲染尺寸标记.jpeg"),
("image/70feecf18b91882e650dbba95bcfdfb1.jpeg", "image/吊顶收口节点CAD图.jpeg"),
("image/b9a514a3954c830f3f5b45b81b8301c5.jpeg", "image/地面与墙面收口CAD图.jpeg"),
("image/d23232e2769d0969a427b4aa29134e82.jpeg", "image/窗帘盒尺寸CAD图.jpeg"),
("image/dfece96370f9bdbd70acd27f6e9da7de.jpeg", "image/CAD绘制强弱电布置图.jpeg"),
("image/9a7d365a669f93b14287cf5cb79afaf9.jpeg", "image/材质选型.jpeg"),
("image/644350be0388ea75dd11a07616f568f5.jpeg", "image/尺寸标注.jpeg"),
("image/119c8140-6180-47b3-bf50-7324a47d3d57.jpg", "image/效果渲染图加尺寸标注.jpg"),
# 视频链接需要特殊处理因为有很长的URL编码文件名
]
print("开始更新 Markdown 文件中的图片引用...")
# 读取文件
with open(md_file, 'r', encoding='utf-8') as f:
content = f.read()
# 替换图片路径
for old_path, new_path in replacements:
if old_path in content:
content = content.replace(old_path, new_path)
print(f"✓ 替换: {old_path} -> {new_path}")
else:
print(f"✗ 未找到: {old_path}")
# 处理视频链接简化超长的URL编码文件名
# 查找并替换视频链接
video_pattern = r'\[户型生长侘寂风墙体动画客厅漫游视频 设计户型墙体生长动画\]\(image/.*?\.mp4\)'
video_replacement = '[户型生长侘寂风墙体动画客厅漫游视频 设计户型墙体生长动画](image/户型生长动画.mp4)'
if re.search(video_pattern, content):
content = re.sub(video_pattern, video_replacement, content)
print("✓ 替换: 视频链接")
# 写回文件
with open(md_file, 'w', encoding='utf-8') as f:
f.write(content)
print("\nMarkdown 文件更新完成!")