MCPcopy Create free account
hub / github.com/DSGWJQ/Feagent / update_api_doc

Function update_api_doc

scripts/update_docs_version.py:74–105  ·  view source on GitHub ↗

更新API文档日期

()

Source from the content-addressed store, hash-verified

72
73
74def update_api_doc():
75 """更新API文档日期"""
76 doc = PROJECT_ROOT / "docs" / "api" / "workflow_platform_api.md"
77
78 if not doc.exists():
79 print(f" [WARN] File not found: {doc}")
80 return False
81
82 try:
83 content = doc.read_text(encoding="utf-8")
84 lines = content.split("\n")
85
86 # 检查是否已有更新日期
87 has_date = any("最后更新" in line or "Last Updated" in line for line in lines[:5])
88
89 if not has_date:
90 # 在标题后添加日期(假设第一行是标题)
91 if lines and lines[0].startswith("#"):
92 lines.insert(1, "")
93 lines.insert(2, "**Last Updated**: 2025-12-13")
94 lines.insert(3, "")
95
96 doc.write_text("\n".join(lines), encoding="utf-8")
97 print(" [OK] Updated workflow_platform_api.md")
98 print(" - Added update date: 2025-12-13")
99 return True
100 else:
101 print(" [INFO] workflow_platform_api.md - already has date marker")
102 return True
103 except Exception as e:
104 print(f" [ERROR] Update failed: {e}")
105 return False
106
107
108def main():

Callers 1

mainFunction · 0.85

Calls 1

existsMethod · 0.45

Tested by

no test coverage detected