docrawl
A documentation-focused web crawler that converts sites to clean Markdown while preserving structure and staying polite.
Demo Video • Crates.io • GitHub
Installation
# Install from crates.io
# Or build from source
Quick Start
Key Features
- Documentation-optimized extraction - Built-in selectors for Docusaurus, MkDocs, Sphinx, Next.js docs
- Clean Markdown output - Preserves code blocks, tables, and formatting with YAML frontmatter metadata
- Path-mirroring structure - Maintains original URL hierarchy as folders with
index.mdfiles - Polite crawling - Respects robots.txt, rate limits, and sitemap hints
- Security-first - Sanitizes content, detects prompt injections, quarantines suspicious pages
- Resumable sessions - Persistent cache allows stopping and continuing crawls
Why docrawl?
Unlike general-purpose crawlers, docrawl is purpose-built for documentation:
| Tool | Purpose | Output | Documentation Support |
|---|---|---|---|
| wget/curl | File downloading | Raw HTML | No extraction |
| httrack | Website mirroring | Full HTML site | No Markdown conversion |
| scrapy | Web scraping framework | Custom formats | Requires coding |
| docrawl | Documentation crawler | Clean Markdown | Auto-detects docs frameworks |
docrawl combines crawling, extraction, and conversion in a single tool optimized for technical documentation.
Library Usage
Add to your Cargo.toml:
[]
= "0.1"
= { = "1", = ["full"] }
Minimal example:
async
CLI Options
| Option | Description | Default |
|---|---|---|
--depth <n> |
Maximum crawl depth | 10 |
--all |
Crawl entire site | - |
--output <dir> |
Output directory | Current dir |
--rate <n> |
Requests per second | 2 |
--concurrency <n> |
Parallel workers | 8 |
--selector <css> |
Custom content selector | Auto-detect |
--fast |
Quick mode (no assets, rate=16) | - |
--resume |
Continue previous crawl | - |
--silence |
Suppress built-in progress/status output | - |
Configuration
Optional docrawl.config.json:
Output Structure
output/
└── example.com/
├── index.md
├── guide/
│ └── index.md
├── assets/
│ └── images/
└── manifest.json
Each Markdown file includes frontmatter:
---
title: Page Title
source_url: https://example.com/page
fetched_at:
---
License
MIT