feat: 文档同步

This commit is contained in:
2025-12-15 18:53:39 +08:00
parent 67162d2337
commit 1329643932
16 changed files with 987 additions and 85 deletions

10
cache/update_docs.sh vendored Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
cd /home/user/temp/ccoptimize/aide-marketplace/aide-plugin/docs/commands
# 重命名旧设计文档
mv init.md _deprecated_init.md 2>/dev/null || echo "init.md 不存在"
mv prep.md _deprecated_prep.md 2>/dev/null || echo "prep.md 不存在"
mv exec.md _deprecated_exec.md 2>/dev/null || echo "exec.md 不存在"
echo "旧设计文档已重命名"
ls -la

66
cache/verify_links.sh vendored Executable file
View File

@@ -0,0 +1,66 @@
#!/bin/bash
# 验证文档导览链接有效性
cd /home/user/temp/ccoptimize
echo "=== 验证导览链接 ==="
echo ""
# 定义要检查的文档文件
docs=(
"docs/aide-overview.md"
"aide-marketplace/aide-plugin/docs/README.md"
"aide-marketplace/aide-plugin/docs/commands/setup.md"
"aide-marketplace/aide-plugin/docs/commands/load.md"
"aide-marketplace/aide-plugin/docs/commands/docs.md"
"aide-marketplace/aide-plugin/docs/commands/run.md"
"aide-program/docs/README.md"
"aide-program/docs/commands/flow.md"
"aide-program/docs/formats/config.md"
)
errors=0
for doc in "${docs[@]}"; do
if [ ! -f "$doc" ]; then
echo "✗ 文档不存在: $doc"
((errors++))
continue
fi
dir=$(dirname "$doc")
# 提取所有 markdown 链接
links=$(grep -oE '\[([^]]+)\]\(([^)]+)\)' "$doc" | grep -oE '\(([^)]+)\)' | tr -d '()' | grep -v '^http' | grep -v '^#')
if [ -z "$links" ]; then
echo "$doc: 无相对链接"
continue
fi
doc_errors=0
for link in $links; do
# 解析相对路径
target="$dir/$link"
# 移除锚点
target=$(echo "$target" | sed 's/#.*//')
if [ ! -e "$target" ]; then
echo "$doc: 链接无效 -> $link"
((doc_errors++))
((errors++))
fi
done
if [ $doc_errors -eq 0 ]; then
echo "$doc: 所有链接有效"
fi
done
echo ""
echo "=== 验证完成 ==="
if [ $errors -eq 0 ]; then
echo "✓ 所有链接有效"
else
echo "✗ 发现 $errors 个无效链接"
fi