Evals / documents / Read a document

Clean a web page

Convert the article in article.html to Markdown without the site navigation. Save it as article.md.

normalsingledeft html to-md

The task

The reference answer shows the job can be done with deft. It is not an agent run.

deft html to-md article.html --main -o article.md

Input

<!doctype html>
<html lang="en">
<head><title>Tea exports in 2025</title><style>body{font-family:serif}</style><script>track()</script></head>
<body>
<header><a href="/">Daily Leaf</a></header>
<nav><ul><li><a href="/news">News</a></li><li><a href="/about">About us</a></li></ul></nav>
<main>
<article>
<h1>Tea exports in 2025</h1>
<p>Exports rose for the third year in a row, led by <strong>Kenya</strong> and Sri Lanka. Growers credit a mild season and steady demand from the Gulf states, while shipping costs fell back after two difficult years.</p>
<h2>By country</h2>
<table><thead><tr><th>Country</th><th>Tonnes</th></tr></thead><tbody><tr><td>Kenya</td><td>590000</td></tr><tr><td>Sri Lanka</td><td>245000</td></tr></tbody></table>
<ul><li>Prices were stable</li><li>Green tea grew fastest</li></ul>
</article>
</main>
<aside>Subscribe to our newsletter</aside>
<footer>Copyright Daily Leaf</footer>
<script>analytics()</script>
</body>
</html>

Reference output

# Tea exports in 2025

Exports rose for the third year in a row, led by **Kenya** and Sri Lanka. Growers credit a mild season and steady demand from the Gulf states, while shipping costs fell back after two difficult years.

## By country

| Country   | Tonnes |
| --------- | ------ |
| Kenya     | 590000 |
| Sri Lanka | 245000 |

*   Prices were stable
*   Green tea grew fastest
How a result is judged (1 check)
  • text: file = "article.md", contains = ["# Tea exports", "590000"], absent = ["About us", "newsletter", "track()"]

Runs

CodexWithout deftPassed2026-11-07

Time
13s
New tokens
3.8k
Total input
54.2k
Output tokens
0.3k
Commands
2
Failed
0

Trace

  1. I’ll inspect `article.html`, then write a clean Markdown version of the article content to `article.md`, excluding site navigation.

  2. pwd && rg --files -g 'article.html' -g 'AGENTS.md'
    output
    article.html
  3. cat article.html
    output
    <!doctype html>
    <html lang="en">
    <head><title>Tea exports in 2025</title><style>body{font-family:serif}</style><script>track()</script></head>
    <body>
    <header><a href="/">Daily Leaf</a></header>
    <nav><ul><li><a href="/news">News</a></li><li><a href="/about">About us</a></li></ul></nav>
    <main>
    <article>
    <h1>Tea exports in 2025</h1>
    <p>Exports rose for the third year in a row, led by <strong>Kenya</strong> and Sri Lanka. Growers credit a mild season and steady demand from the Gulf states, while shipping costs fell back after two difficult years.</p>
    <h2>By country</h2>
    <table><thead><tr><th>Country</th><th>Tonnes</th></tr></thead><tbody><tr><td>Kenya</td><td>590000</td></tr><tr><td>Sri Lanka</td><td>245000</td></tr></tbody></table>
    <ul><li>Prices were stable</li><li>Green tea grew fastest</li></ul>
    </article>
    </main>
    <aside>Subscribe to our newsletter</aside>
    <footer>Copyright Daily Leaf</footer>
    <script>analytics()</script>
    </body>
    </html>
  4. Edited article.md

  5. Saved the article as [article.md](article.md), excluding site navigation and other page elements.

Output

# Tea exports in 2025

Exports rose for the third year in a row, led by **Kenya** and Sri Lanka. Growers credit a mild season and steady demand from the Gulf states, while shipping costs fell back after two difficult years.

## By country

| Country | Tonnes |
| --- | ---: |
| Kenya | 590000 |
| Sri Lanka | 245000 |

- Prices were stable
- Green tea grew fastest

CodexWith deft, skill installedPassedRead the skillUsed deft2026-11-07

Time
14s
New tokens
9.2k
Total input
72.7k
Output tokens
0.3k
Commands
4
Failed
0

Trace

  1. I’ll read `article.html`, convert the article content while excluding site navigation, and save the result as `article.md` in this directory.

  2. cat .agents/skills/deft/SKILL.md && pwd && ls -la && sed -n '1,240p' article.html
    output
    ---
    name: deft
    description: "Use deft first for any simple, direct operation on local files, whatever the type: convert, read, extract, edit, compress, merge, split, compare or inspect. Try it before writing a script or one-liner. If unsure, run deft find; if it says no command does this, use another tool. Not for programming work: to read, write or change source code, skip it."
    ---
    
    # deft
    
    One local command for file jobs. Prefer it over writing Python or shell scripts.
    
    Syntax: `deft <group> <command> [inputs] [-o output] [--options]`
    
    Groups:
    - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert
    - `image`: Resize, crop, convert, compress, adjust, montage, OCR
    - `video`: Trim, merge, convert, compress, subtitles, GIF, frames (ffmpeg)
    - `audio`: Convert, trim, normalize, denoise, cut silence (ffmpeg)
    - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace
    - `slides`: PowerPoint: extract text, Markdown outline
    - `sheet`: Excel/CSV/ODS tables: SQL query, pivot, merge, split, convert
    - `json`: JSON: convert, format, merge, diff, validate
    - `toml`: TOML: convert, format, merge, diff, validate
    - `xml`: XML: convert, format, merge, diff, validate
    - `yaml`: YAML: convert, format, merge, diff, validate
    - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents
    - `html`: HTML to Markdown, text, Word and PDF
    - `epub`: E-books: info, to text, Markdown and PDF
    - `gps`: GPX and KML tracks: convert, distance and time
    - `qr`: Create QR codes and barcodes; r
    … 1883 more characters
  3. The article is clearly bounded by `<article>` tags. I’m converting that section only, keeping its heading, emphasis, table, and list.

  4. deft html --help
    output
    deft html - commands (input -> output)
      to-docx  html -> docx  Convert the content to a Word document
      to-md    html -> md    Convert to Markdown; scripts and styles are dropped
      to-pdf   html -> pdf   Typeset as PDF, content not layout [beta]
      to-text  html -> txt   Extract the readable text
    More: deft html <command> --help
  5. deft html to-md --help
    output
    deft html to-md - Convert to Markdown; scripts and styles are dropped
    Same as: deft md from-html · deft convert
    
    Usage: deft html to-md <html>... [-o <md|dir>] [options]
    In: html (each handled separately)   Out: md (default <name>.<ext>)
    
    Options:
      --main                       Only the article, without site navigation
    Common: -o --force --dry-run --json -j   (deft help common)
    
    Examples:
      deft html to-md page.html -o page.md
  6. deft html to-md article.html -o article.md --main && cat article.md
    output
    ok html.to-md article.html -> article.md  383B  0.02s
    # Tea exports in 2025
    
    Exports rose for the third year in a row, led by **Kenya** and Sri Lanka. Growers credit a mild season and steady demand from the Gulf states, while shipping costs fell back after two difficult years.
    
    ## By country
    
    | Country   | Tonnes |
    | --------- | ------ |
    | Kenya     | 590000 |
    | Sri Lanka | 245000 |
    
    *   Prices were stable
    *   Green tea grew fastest
  7. Converted the article content, excluding site navigation, and saved it as [article.md](article.md).

Output

# Tea exports in 2025

Exports rose for the third year in a row, led by **Kenya** and Sri Lanka. Growers credit a mild season and steady demand from the Gulf states, while shipping costs fell back after two difficult years.

## By country

| Country   | Tonnes |
| --------- | ------ |
| Kenya     | 590000 |
| Sri Lanka | 245000 |

*   Prices were stable
*   Green tea grew fastest

Claude Opus 5.5Without deftPassed2026-11-07

Time
11s
New tokens
9.7k
Total input
57.4k
Output tokens
0.7k
Commands
0
Failed
0

Trace

    Output

    # Tea exports in 2025
    
    Exports rose for the third year in a row, led by **Kenya** and Sri Lanka. Growers credit a mild season and steady demand from the Gulf states, while shipping costs fell back after two difficult years.
    
    ## By country
    
    | Country | Tonnes |
    | --- | --- |
    | Kenya | 590000 |
    | Sri Lanka | 245000 |
    
    - Prices were stable
    - Green tea grew fastest
    

    Claude Opus 5.5With deft, skill installedPassedRead the skillUsed deft2026-11-07

    Time
    13s
    New tokens
    10.0k
    Total input
    59.4k
    Output tokens
    0.5k
    Commands
    0
    Failed
    0

    Trace

      Output

      ---
      name: deft
      description: "Use deft first for any simple, direct operation on local files, whatever the type: convert, read, extract, edit, compress, merge, split, compare or inspect. Try it before writing a script or one-liner. If unsure, run deft find; if it says no command does this, use another tool. Not for programming work: to read, write or change source code, skip it."
      ---
      
      # deft
      
      One local command for file jobs. Prefer it over writing Python or shell scripts.
      
      Syntax: `deft <group> <command> [inputs] [-o output] [--options]`
      
      Groups:
      - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert
      - `image`: Resize, crop, convert, compress, adjust, montage, OCR
      - `video`: Trim, merge, convert, compress, subtitles, GIF, frames (ffmpeg)
      - `audio`: Convert, trim, normalize, denoise, cut silence (ffmpeg)
      - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace
      - `slides`: PowerPoint: extract text, Markdown outline
      - `sheet`: Excel/CSV/ODS tables: SQL query, pivot, merge, split, convert
      - `json`: JSON: convert, format, merge, diff, validate
      - `toml`: TOML: convert, format, merge, diff, validate
      - `xml`: XML: convert, format, merge, diff, validate
      - `yaml`: YAML: convert, format, merge, diff, validate
      - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents
      - `html`: HTML to Markdown, text, Word and PDF
      - `epub`: E-books: info, to text, Markdown and PDF
      - `gps`: GPX and KML tracks: convert, distance and time
      - `qr`: Create QR codes and barcodes; read QR codes
      
      How to use it:
      1. Run `deft <group>` to list commands, or `deft find "<what you want>"` to search. If it says `no command does this`, use another tool.
      2. Run `deft <group> <command> --help` for options and examples.
      3. `deft convert <in> -o <out.ext>` converts between formats by extension.
      4. Results are one line starting with `ok`, `partial` or `error`; add `--json` to parse them. Errors include a `hint:` with the fix.
      
      Inputs are never overwritten; pass `--force` or `--in-place` to allow it. Globs and directories work as inputs; several inputs run in parallel.
      
      If `deft` is not installed, ask the user, then follow https://github.com/firstprayer/deft/blob/main/docs/INSTALL.md
      
      # Tea exports in 2025
      
      Exports rose for the third year in a row, led by **Kenya** and Sri Lanka. Growers credit a mild season and steady demand from the Gulf states, while shipping costs fell back after two difficult years.
      
      ## By country
      
      | Country   | Tonnes |
      | --------- | ------ |
      | Kenya     | 590000 |
      | Sri Lanka | 245000 |
      
      *   Prices were stable
      *   Green tea grew fastest
      

      Claude CodeWithout deftNot run yet

      Claude CodeWith deftNot run yet