feat: add tmp/ directory for temp files and cookie, add .gitignore
- tmp/ 用于存放临时文件(文档缓存、cookie等),已加入 .gitignore - 文档中所有临时文件和 cookie 路径统一指向 tmp/ - SKILL.md 架构图增加 tmp/ 说明 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,12 +42,12 @@ mcporter call tencent-docs smartcanvas.read file_id=<FILE_ID> size=10
|
||||
|
||||
```bash
|
||||
# 获取完整文档结构
|
||||
mcporter call tencent-docs doc.resolve_document_structure file_id=<FILE_ID> > doc_raw.json
|
||||
mcporter call tencent-docs doc.resolve_document_structure file_id=<FILE_ID> > tmp/doc_raw.json
|
||||
|
||||
# 提取纯文本
|
||||
python -X utf8 -c "
|
||||
import json
|
||||
with open('doc_raw.json','r',encoding='utf-8') as f:
|
||||
with open('tmp/doc_raw.json','r',encoding='utf-8') as f:
|
||||
data=json.load(f)
|
||||
texts=[]
|
||||
for n in data.get('nodes',[]):
|
||||
@@ -55,13 +55,13 @@ for n in data.get('nodes',[]):
|
||||
hl=n.get('heading_level',0)
|
||||
if p:
|
||||
texts.append(('#'*hl+' '+p) if hl>0 else p)
|
||||
with open('doc_content.txt','w',encoding='utf-8') as f:
|
||||
with open('tmp/doc_content.txt','w',encoding='utf-8') as f:
|
||||
f.write('\n'.join(texts))
|
||||
print(f'Done: {len(texts)} paragraphs')
|
||||
"
|
||||
|
||||
# 清理中间文件
|
||||
rm doc_raw.json
|
||||
rm tmp/doc_raw.json
|
||||
```
|
||||
|
||||
### 第二步 B:smartcanvas 类型(支持分页)
|
||||
|
||||
Reference in New Issue
Block a user