diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d932c8e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# 临时文件 / 配置文件,不纳入版本管理 +tmp/ diff --git a/SKILL.md b/SKILL.md index 989c736..909043e 100644 --- a/SKILL.md +++ b/SKILL.md @@ -28,6 +28,11 @@ media-center/ │ └── quark/ │ └── v1/{install,usage,maintain}.md │ +├── tmp/ # 临时文件 / cookie(已 gitignore) +│ ├── cookie_quark.txt # 夸克 Cookie +│ ├── doc_raw.json # 文档结构缓存 +│ └── doc_content.txt # 提取的全文缓存 +│ └── ref/ # 参考归档 ├── tencent-docs/ ├── tx-doc-large-reader/ diff --git a/sources/tencent-doc/v1/usage.md b/sources/tencent-doc/v1/usage.md index 07082d9..3a51c37 100644 --- a/sources/tencent-doc/v1/usage.md +++ b/sources/tencent-doc/v1/usage.md @@ -42,12 +42,12 @@ mcporter call tencent-docs smartcanvas.read file_id= size=10 ```bash # 获取完整文档结构 -mcporter call tencent-docs doc.resolve_document_structure file_id= > doc_raw.json +mcporter call tencent-docs doc.resolve_document_structure 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 类型(支持分页) diff --git a/storage/quark/v1/install.md b/storage/quark/v1/install.md index acf69ac..20adedb 100644 --- a/storage/quark/v1/install.md +++ b/storage/quark/v1/install.md @@ -30,8 +30,8 @@ mcporter config add netdisk \ --env "NETDISK_QUARK_COOKIE=粘贴你的完整Cookie" ``` -> Cookie 是敏感信息,建议保存在单独的文件(如 `项目根目录/cookie/quark.txt`)中, -> 使用时 `COOKIE=$(cat cookie/quark.txt)`,避免在命令行历史中泄露。 +> Cookie 是敏感信息,保存在 `tmp/cookie_quark.txt`(已加入 `.gitignore`), +> 使用时 `COOKIE=$(cat tmp/cookie_quark.txt)`,避免在命令行历史中泄露。 ### 3. 验证 diff --git a/storage/quark/v1/usage.md b/storage/quark/v1/usage.md index 19ca6db..a54ee60 100644 --- a/storage/quark/v1/usage.md +++ b/storage/quark/v1/usage.md @@ -69,7 +69,7 @@ mcporter call 'netdisk.list(cloud: "quark", path: "/目标目录")' ```bash # 从文件读取避免泄露(推荐) -COOKIE=$(cat cookie/quark.txt) +COOKIE=$(cat tmp/cookie_quark.txt) # 或直接写入(注意命令行历史) # COOKIE="你的夸克Cookie"