canghe-url-to-markdown by freestylefly/canghe-skills
npx skills add https://github.com/freestylefly/canghe-skills --skill canghe-url-to-markdown通过 Chrome CDP 获取任何 URL 并将 HTML 转换为干净的 Markdown。
重要提示:所有脚本都位于此技能的 scripts/ 子目录中。
智能体执行说明:
SKILL_DIR${SKILL_DIR}/scripts/<脚本名称>.ts${SKILL_DIR} 替换为实际路径脚本参考:
| 脚本 | 用途 |
|---|---|
scripts/main.ts | 用于 URL 获取的 CLI 入口点 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
使用 Bash 检查 EXTEND.md 是否存在(优先级顺序):
# 首先检查项目级别
test -f .canghe-skills/canghe-url-to-markdown/EXTEND.md && echo "project"
# 然后检查用户级别(跨平台:$HOME 在 macOS/Linux/WSL 上有效)
test -f "$HOME/.canghe-skills/canghe-url-to-markdown/EXTEND.md" && echo "user"
┌────────────────────────────────────────────────────────┬───────────────────┐ │ 路径 │ 位置 │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ .canghe-skills/canghe-url-to-markdown/EXTEND.md │ 项目目录 │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.canghe-skills/canghe-url-to-markdown/EXTEND.md │ 用户主目录 │ └────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ 结果 │ 操作 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 找到 │ 读取、解析、应用设置 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 未找到 │ 使用默认值 │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md 支持:默认输出目录 | 默认捕获模式 | 超时设置
# 自动模式(默认)- 页面加载时捕获
npx -y bun ${SKILL_DIR}/scripts/main.ts <url>
# 等待模式 - 捕获前等待用户信号
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> --wait
# 保存到指定文件
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> -o output.md
| 选项 | 描述 |
|---|---|
<url> | 要获取的 URL |
-o <路径> | 输出文件路径(默认:自动生成) |
--wait | 捕获前等待用户信号 |
--timeout <毫秒> | 页面加载超时时间(默认:30000) |
| 模式 | 行为 | 适用场景 |
|---|---|---|
| 自动(默认) | 网络空闲时捕获 | 公开页面、静态内容 |
等待 (--wait) | 用户准备就绪时发出信号 | 需要登录、懒加载、付费墙 |
等待模式工作流程:
--wait 运行 → 脚本输出 "准备就绪后按 Enter"包含 url、title、description、author、published、captured_at 字段的 YAML 前置元数据,后跟转换后的 Markdown 内容。
url-to-markdown/<域名>/<短链>.md
<短链>:来自页面标题或 URL 路径(短横线连接,2-6 个单词)<短链>-YYYYMMDD-HHMMSS.md| 变量 | 描述 |
|---|---|
URL_CHROME_PATH | 自定义 Chrome 可执行文件路径 |
URL_DATA_DIR | 自定义数据目录 |
URL_CHROME_PROFILE_DIR | 自定义 Chrome 配置文件目录 |
故障排除:找不到 Chrome → 设置 URL_CHROME_PATH。超时 → 增加 --timeout。复杂页面 → 尝试 --wait 模式。
通过 EXTEND.md 进行自定义配置。有关路径和支持的选项,请参阅 偏好设置 部分。
每周安装数
112
代码仓库
GitHub 星标数
183
首次出现
2026年2月24日
安全审计
安装于
github-copilot111
gemini-cli111
codex111
kimi-cli111
cursor111
opencode111
Fetches any URL via Chrome CDP and converts HTML to clean markdown.
Important : All scripts are located in the scripts/ subdirectory of this skill.
Agent Execution Instructions :
SKILL_DIR${SKILL_DIR}/scripts/<script-name>.ts${SKILL_DIR} in this document with the actual pathScript Reference :
| Script | Purpose |
|---|---|
scripts/main.ts | CLI entry point for URL fetching |
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .canghe-skills/canghe-url-to-markdown/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.canghe-skills/canghe-url-to-markdown/EXTEND.md" && echo "user"
┌────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ .canghe-skills/canghe-url-to-markdown/EXTEND.md │ Project directory │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.canghe-skills/canghe-url-to-markdown/EXTEND.md │ User home │ └────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md Supports : Default output directory | Default capture mode | Timeout settings
# Auto mode (default) - capture when page loads
npx -y bun ${SKILL_DIR}/scripts/main.ts <url>
# Wait mode - wait for user signal before capture
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> --wait
# Save to specific file
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> -o output.md
| Option | Description |
|---|---|
<url> | URL to fetch |
-o <path> | Output file path (default: auto-generated) |
--wait | Wait for user signal before capturing |
--timeout <ms> | Page load timeout (default: 30000) |
| Mode | Behavior | Use When |
|---|---|---|
| Auto (default) | Capture on network idle | Public pages, static content |
Wait (--wait) | User signals when ready | Login-required, lazy loading, paywalls |
Wait mode workflow :
--wait → script outputs "Press Enter when ready"YAML front matter with url, title, description, author, published, captured_at fields, followed by converted markdown content.
url-to-markdown/<domain>/<slug>.md
<slug>: From page title or URL path (kebab-case, 2-6 words)<slug>-YYYYMMDD-HHMMSS.md| Variable | Description |
|---|---|
URL_CHROME_PATH | Custom Chrome executable path |
URL_DATA_DIR | Custom data directory |
URL_CHROME_PROFILE_DIR | Custom Chrome profile directory |
Troubleshooting : Chrome not found → set URL_CHROME_PATH. Timeout → increase --timeout. Complex pages → try --wait mode.
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
Weekly Installs
112
Repository
GitHub Stars
183
First Seen
Feb 24, 2026
Security Audits
Gen Agent Trust HubPassSocketWarnSnykWarn
Installed on
github-copilot111
gemini-cli111
codex111
kimi-cli111
cursor111
opencode111
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
43,100 周安装
业务逻辑测试审计器:自动化检测框架库测试,提升测试代码质量
224 周安装
使用 Remotion 创建 Kurzgesagt 风格教育视频 - 专业视频制作技能指南
221 周安装
Neon Drizzle 集成指南:为 Neon 数据库设置 Drizzle ORM 的完整解决方案
225 周安装
Elasticsearch安全故障排除指南:诊断401/403错误、TLS证书、API密钥和许可证问题
219 周安装
学术论文LaTeX模板库:Nature/Science/IEEE期刊会议海报申请书模板
224 周安装
应用程序性能优化全栈指南:从分析、数据库到前端与CDN的端到端优化
227 周安装