# Changelog

This changelog is generated automatically from [GitHub Releases](https://github.com/posit-dev/nokap/releases).

## v0.1.0

*2026-06-08* · [GitHub](https://github.com/posit-dev/nokap/releases/tag/v0.1.0)

**Initial release** -- Capture screenshots and PDFs from web pages using headless Chrome via CDP.

#### Highlights

nokap gives you high-quality screenshots and PDFs from any URL, local HTML file, or raw HTML string. It auto-discovers Chrome, manages the browser lifecycle, and produces pixel-perfect output with a simple two-argument API: `nokap.webshot(url, file)`.

#### Core Features

- **Screenshot capture** in PNG, JPEG, and WebP formats with configurable viewport and zoom
- **PDF generation** -- full-page PDFs with standard paper sizes, or element-bounded vector PDFs sized exactly to content
- **CSS selector targeting** -- crop to any element's bounding box with optional padding
- **Auto-detection of wide elements** -- tables and other intrinsically-wide content render at their natural width without clipping
- **High-DPI output** via zoom factor (2x, 3x) for Retina-quality images
- **Raw HTML rendering** with [from_html()](./reference/from_html.md#nokap.from_html) -- ideal for capturing output from Great Tables, Plotly, or custom templates
- **Automatic browser management** -- Chrome starts on first use, stays alive across captures, cleans up at exit

#### Python API

| Function | Description |
|----|----|
| `nokap.webshot(url, file)` | Capture a URL or local file as an image or PDF |
| `nokap.from_html(html, file)` | Render an HTML string to an image or PDF |
| [nokap.close()](./reference/close.md#nokap.close) | Explicitly close the browser (automatic at exit) |
| [nokap.find_chrome()](./reference/find_chrome.md#nokap.find_chrome) | Locate the Chrome/Chromium binary |

#### CLI Commands

| Command           | Description                                         |
|-------------------|-----------------------------------------------------|
| `nokap webshot`   | Capture a URL or local file as an image or PDF      |
| `nokap from-html` | Render an HTML file to an image or PDF              |
| `nokap batch`     | Process multiple capture jobs from a JSON manifest  |
| `nokap doctor`    | Run full diagnostics (browser check + test capture) |
| `nokap info`      | Display system info and browser availability        |

#### MCP Server

nokap ships an MCP (Model Context Protocol) server for AI agent integration. Install with `pip install nokap[mcp]` and connect from Claude, Copilot, Cursor, or any MCP-compatible client.

| Tool              | Description                                   |
|-------------------|-----------------------------------------------|
| `screenshot_url`  | Capture a screenshot from a URL or local file |
| `screenshot_html` | Capture a screenshot from a raw HTML string   |
| `generate_pdf`    | Generate a full-page or element-bounded PDF   |
| `doctor`          | Verify system readiness                       |

#### Agent Skills

Four published skills provide structured context for AI coding agents:

- `nokap`: Primary skill with decision table, API overview, and gotchas
- `nokap-web-capture`: Capturing from live URLs
- `nokap-html-capture`: Rendering HTML strings and local files
- `nokap-pdf`: PDF generation and paper configuration

Install with `great-docs skill install nokap` or `npx skills add https://posit-dev.github.io/nokap/`.

#### Error Handling

A structured exception hierarchy with specific error types: [ChromeNotFoundError](./reference/ChromeNotFoundError.md#nokap.ChromeNotFoundError), [ChromeStartError](./reference/ChromeStartError.md#nokap.ChromeStartError), [NavigationError](./reference/NavigationError.md#nokap.NavigationError), [PageLoadTimeout](./reference/PageLoadTimeout.md#nokap.PageLoadTimeout), [SelectorError](./reference/SelectorError.md#nokap.SelectorError), and [CDPError](./reference/CDPError.md#nokap.CDPError): all inheriting from [NokapError](./reference/NokapError.md#nokap.NokapError).

#### Requirements

- Python \>= 3.10
- Chrome or Chromium (must be installed separately; set `CHROME_PATH` if not in a standard location)
