agentleFS
appautomatonappautomaton/webmaton/skills/html-to-markdown/SKILL.md

html-to-markdown

Skill20 starsChanged 3 months agoMITView on GitHub

Convert 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.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add --wait-selector <css> or --wait-text <string> to the capture step for pages that need a readiness signal.

    line 27
  2. Distinctive:

    Prefer a simple fetch over browser capture for static articles, wikis, and server-rendered docs.

    line 28
  3. Distinctive:

    Read only when needed:

    line 54

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

HTML to Markdown

Composes with

  • Use for — capture-a-web-page tasks where browser-rendered HTML or structured Markdown is needed.
  • 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.
  • Outputs — JSON envelope by default (markdown body + metadata + links + images + quality signals). Use --output-format markdown when only the raw Markdown body is needed.

Converts a URL or HTML into clean Markdown plus metadata, links, images, and quality signals.

From a URL

Capture the page and convert in one pipeline:

uv run --script scripts/capture_html.py <url> \
  | uv run --script scripts/markmaton_convert.py --from-capture --output-format json

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.

  • Add --wait-selector <css> or --wait-text <string> to the capture step for pages that need a readiness signal.
  • Prefer a simple fetch over browser capture for static articles, wikis, and server-rendered docs.

From HTML

uv run --script scripts/markmaton_convert.py --html-file page.html \
  --url <url> --output-format json

Or from stdin:

echo "$html" | uv run --script scripts/markmaton_convert.py --url <url>

Pass --url when available — it improves link resolution and canonical metadata.

Key defaults

  • Output: json. Use --output-format markdown for raw Markdown only.
  • Main-content extraction: on. Use --full-content to disable.
  • Capture: always headless. Timeout 10s, override with --timeout.
  • Browser discovery: user's Chrome → user's Chromium → Playwright's Chromium.

References

Read only when needed:

  • references/usage.md — full CLI reference for both scripts
  • references/integration-patterns.md — browser vs fetch guidance, contracts, parser defaults

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.