From siyuan
Imports web articles from WeChat, Zhihu, Juejin, and blogs into SiYuan notes. Handles image downloads/uploads, content formatting, document creation, and duplicate prevention. Use for saving webpages or scraping content.
How this skill is triggered — by the user, by Claude, or both
Slash command
/siyuan:siyuan-article-importThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
从各种来源(微信公众号、知乎、掘金、博客等)抓取文章并导入到思源笔记。
从各种来源(微信公众号、知乎、掘金、博客等)抓取文章并导入到思源笔记。
# 导入单篇文章
python scripts/import_article.py <文章URL>
# 指定笔记本
python scripts/import_article.py <文章URL> <笔记本名称>
import subprocess
# 上传单张图片
result = subprocess.run([
'python', 'scripts/upload_image.py',
'https://example.com/image.jpg', '图片描述'
], capture_output=True, text=True)
if result.returncode == 0:
_, asset_path, _ = result.stdout.strip().split('|', 2)
print(f"资源路径:{asset_path}")
| 来源 | 域名 | 特殊处理 |
|---|---|---|
| 微信公众号 | mp.weixin.qq.com | 图片必须下载 |
| 知乎专栏 | zhuanlan.zhihu.com | 移除推荐内容 |
| 掘金 | juejin.cn | 处理代码块 |
| 其他博客 | 任意 URL | 检查防盗链 |
网络图片(尤其是微信)不能直接在思源显示,会自动:
创建文档前自动检查是否已存在,避免重复。
网络文章统一存入 知识储备 笔记本,自动创建。
重要:Windows 下必须使用 Python 脚本调用 API,避免 curl 中文乱码
# ✅ 正确
response = requests.post(
f'{api_url}/api/filetree/createDocWithMd?token={token}',
json={'notebook': nb_id, 'path': '/标题', 'markdown': content}
)
# ❌ 错误(会产生乱码)
curl -X POST "..." -d '{"markdown": "中文内容"}'
使用简单字符,避免特殊符号:
✅ /技术文章-20250125
✅ /RDL技术详解
❌ /标题:包含@#$特殊字符
推荐在仓库根目录放置 .claude/siyuan.json(也兼容根目录 siyuan.json):
{
"api_url": "http://127.0.0.1:6806",
"api_token": "your-api-token",
"local_path": "/path/to/siyuan/workspace"
}
local_path 应指向思源工作目录根目录,资源会保存到 {local_path}/data/assets/local_path 应填写宿主机挂载路径,而不是容器内路径remote_path 可以省略,或保留但设置 webdav: falseQ: 图片无法显示?
A: 使用 upload_image.py 下载上传,详见 图片处理参考
Q: 如何验证文档创建成功? A: 使用 SQL 查询验证,详见 API 参考
Q: 如何避免重复创建文档? A: 创建前检查函数,详见 工作流程
npx claudepluginhub zhiluop/siyuan-skills --plugin siyuanEdits SiYuan-flavored Markdown (SFMD) with wiki links, block quotes/embeds, attributes, SQL queries. Use for SiYuan .md files, double-chain syntax, image insertion via Python script.
Imports web pages and WeChat/Twitter articles into WPS Notes while preserving colors, bold, headings, and image placement. Activates on requests to save or import a link.
Ingests external materials (papers, web pages, docs, data, interviews, notes) into a project-scoped Obsidian KB under structured source directories.