web-markdown-navigator

TotalClaw 作者 totalclaw

获取网页并返回干净的 Markdown 而不是原始 HTML。用于用户想要 Markdown 输出的 URL 读取、提取和摘要任务;当提取很薄时,对 JS 重/SPA 页面使用浏览器回退。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~plgonzalezrx8-web-markdown-navigator
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~plgonzalezrx8-web-markdown-navigator/file -o plgonzalezrx8-web-markdown-navigator.md
# Web Markdown Navigator

Use this skill for deterministic URL → markdown extraction.

## Quick flow

1. Run script:
   - `cd /Users/pedrogonzalez/clawd/skills/web-markdown-navigator/scripts`
   - `node fetch-markdown.mjs "<url>" --max-chars 50000`
2. If exit code `0`, return markdown output.
3. If exit code `3` or `4`, or output is thin/boilerplate, use `browser` tool fallback to capture rendered content and return markdown summary.

## Script

`node scripts/fetch-markdown.mjs <url> [--max-chars N] [--timeout-ms N] [--json]`

Behavior:
- Layer 1: Fetch HTML + Mozilla Readability + Turndown markdown conversion.
- Layer 2: Fallback plain-text markdown if extraction is too thin.
- URL safety checks block localhost/private literal IPv4 hosts.

## Output requirements

- Return markdown only (no raw HTML dump).
- Preserve source URL in response.
- If truncated, include truncation note.
- If fallback was needed, mention method used (`readability` or `fallback-text`).

## Error handling

- `1` bad args
- `2` invalid/blocked URL
- `3` network/fetch/content-type failure
- `4` extraction failure/thin output

For extended notes and troubleshooting, read:
- `/Users/pedrogonzalez/clawd/skills/web-markdown-navigator/references/usage.md`

---

## 中文说明

# Web Markdown Navigator

使用此技能进行确定性的 URL → Markdown 提取。

## 快速流程

1. 运行脚本:
   - `cd /Users/pedrogonzalez/clawd/skills/web-markdown-navigator/scripts`
   - `node fetch-markdown.mjs "<url>" --max-chars 50000`
2. 如果退出码为 `0`,返回 Markdown 输出。
3. 如果退出码为 `3` 或 `4`,或输出内容稀薄/为样板文本,使用 `browser` 工具回退以捕获渲染后的内容并返回 Markdown 摘要。

## 脚本

`node scripts/fetch-markdown.mjs <url> [--max-chars N] [--timeout-ms N] [--json]`

行为:
- 第 1 层:抓取 HTML + Mozilla Readability + Turndown Markdown 转换。
- 第 2 层:如果提取内容过于稀薄,回退为纯文本 Markdown。
- URL 安全检查会拦截 localhost/私有字面量 IPv4 主机。

## 输出要求

- 仅返回 Markdown(不输出原始 HTML 转储)。
- 在响应中保留源 URL。
- 如果被截断,附上截断提示。
- 如果使用了回退,说明所用方法(`readability` 或 `fallback-text`)。

## 错误处理

- `1` 参数错误
- `2` 无效/被拦截的 URL
- `3` 网络/抓取/内容类型失败
- `4` 提取失败/输出稀薄

如需扩展说明和故障排查,请阅读:
- `/Users/pedrogonzalez/clawd/skills/web-markdown-navigator/references/usage.md`