$npx -y skills add appautomaton/webmaton --skill html-to-markdownConvert a URL or HTML into clean Markdown with metadata using markmaton. Handles browser capture for JS-heavy pages and deterministic HTML-to-Markdown conversion in one skill.
| 1 | # HTML to Markdown |
| 2 | |
| 3 | ## Composes with |
| 4 | |
| 5 | - **Use for** — capture-a-web-page tasks where browser-rendered HTML or structured Markdown is needed. |
| 6 | - **Wraps** — nodriver (CDP-based headless browser capture for JS-heavy pages, with Playwright Chromium discovery) and markmaton (HTML→Markdown with main-content extraction, metadata, and link/image inventory). See `references/integration-patterns.md` for browser-vs-fetch guidance. |
| 7 | - **Outputs** — JSON envelope by default (markdown body + metadata + links + images + quality signals). Use `--output-format markdown` when only the raw Markdown body is needed. |
| 8 | |
| 9 | Converts a URL or HTML into clean Markdown plus metadata, links, images, and quality signals. |
| 10 | |
| 11 | ## From a URL |
| 12 | |
| 13 | Capture the page and convert in one pipeline: |
| 14 | |
| 15 | ```bash |
| 16 | uv run --script scripts/capture_html.py <url> \ |
| 17 | | uv run --script scripts/markmaton_convert.py --from-capture --output-format json |
| 18 | ``` |
| 19 | |
| 20 | The capture script outputs a JSON envelope by default. `--from-capture` reads it and extracts `html`, `url`, `final_url`, and `content_type` automatically — no context lost, URL typed once. |
| 21 | |
| 22 | - Add `--wait-selector <css>` or `--wait-text <string>` to the capture step for pages that need a readiness signal. |
| 23 | - Prefer a simple fetch over browser capture for static articles, wikis, and server-rendered docs. |
| 24 | |
| 25 | ## From HTML |
| 26 | |
| 27 | ```bash |
| 28 | uv run --script scripts/markmaton_convert.py --html-file page.html \ |
| 29 | --url <url> --output-format json |
| 30 | ``` |
| 31 | |
| 32 | Or from stdin: |
| 33 | |
| 34 | ```bash |
| 35 | echo "$html" | uv run --script scripts/markmaton_convert.py --url <url> |
| 36 | ``` |
| 37 | |
| 38 | Pass `--url` when available — it improves link resolution and canonical metadata. |
| 39 | |
| 40 | ## Key defaults |
| 41 | |
| 42 | - Output: `json`. Use `--output-format markdown` for raw Markdown only. |
| 43 | - Main-content extraction: on. Use `--full-content` to disable. |
| 44 | - Capture: always headless. Timeout `10s`, override with `--timeout`. |
| 45 | - Browser discovery: user's Chrome → user's Chromium → Playwright's Chromium. |
| 46 | |
| 47 | ## References |
| 48 | |
| 49 | Read only when needed: |
| 50 | |
| 51 | - `references/usage.md` — full CLI reference for both scripts |
| 52 | - `references/integration-patterns.md` — browser vs fetch guidance, contracts, parser defaults |