Files
hfshfg 8bffa5d9d7 feat(portable): 预装国内渠道+本地模型自动发现+4个新技能
- release.yml 便携包离线预装 钉钉/飞书中国版/企业微信 插件(借鉴 openclaw-china 生态)
- config-server 新增 /api/local-models:自动探测 Ollama/LM Studio 本地模型(借鉴 RealShocky/openclaw-windows)
- Config.html 检测到本地模型自动生成卡片、免 Key 点选即用;新增钉钉渠道卡片
- skills-cn 新增 pdf-toolkit/web-to-markdown/qrcode-maker/image-compress(13→17)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 22:45:59 +08:00

52 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: web-to-markdown
description: "网页转 Markdown - 抓取任意网页正文并转成干净的 Markdown便于阅读/收藏/二次创作"
metadata: { "openclaw": { "emoji": "🔗" } }
---
# 网页转 Markdown
把用户给的网页链接抓下来,提取正文,转成干净的 Markdown方便保存、总结或二次创作。
## 能力概述
- **正文提取**:去掉导航/广告/页脚,只留主体内容
- **转 Markdown**:标题、列表、链接、代码块保留结构
- **保存**:可写入本地 .md 文件
## 操作方式
用 Bash 工具。首选 jina.ai 的免费 reader无需依赖最省事
```bash
# 最简jina reader 直接返回干净 Markdown在链接前加 https://r.jina.ai/
curl -s "https://r.jina.ai/https://example.com/article" -o article.md
echo "已保存 -> article.md"; head -40 article.md
```
离线或 jina 不可用时,用 Python 本地转换:
```bash
python -c "import markdownify,requests" 2>/dev/null || pip install -q markdownify requests beautifulsoup4
python - <<'PY'
import requests, re
from bs4 import BeautifulSoup
from markdownify import markdownify as md
url = "https://example.com/article"
html = requests.get(url, timeout=15, headers={"User-Agent":"Mozilla/5.0"}).text
soup = BeautifulSoup(html, "html.parser")
for t in soup(["script","style","nav","footer","aside"]): t.decompose()
body = soup.find("article") or soup.find("main") or soup.body
out = md(str(body), heading_style="ATX")
out = re.sub(r"\n{3,}", "\n\n", out).strip()
open("article.md","w",encoding="utf-8").write(out)
print("已保存 -> article.md", len(out), "字")
PY
```
## 使用建议
- 先问用户要不要保存到文件、文件名
- 微信公众号/知乎等需要登录的页面可能抓取受限,如失败如实告知
- 抓取后可顺手做"总结要点",结合 china-search / deepseek-helper 技能