Skip to main content

Find broken links in markdown files - CLI + GUI in one

Project description

DeadLink Checker

Find broken links in markdown files - CLI + GUI in a single file

Go Python License

Features

  • ๐Ÿ–ฅ๏ธ Dual Mode: CLI (with args) or GUI (no args) in one file
  • ๐Ÿ”— Local Links: Check relative file paths in markdown
  • ๐ŸŒ Web URLs: Validate HTTP/HTTPS links with caching
  • ๐Ÿ“ Wiki Links: Support for Obsidian-style [[links]]
  • ๐Ÿ”„ Watch Mode: Continuous monitoring with auto-refresh
  • ๐Ÿ“ค Export: Save results to JSON/Markdown
  • โšก Fast: Go version is 20x faster than Python

Quick Start

Python Version

# GUI mode (no arguments)
python3 dead_link_checker.py

# CLI mode
python3 dead_link_checker.py /path/to/markdown

# Check only web URLs
python3 dead_link_checker.py --web /path/to/markdown

# Watch mode (refresh every 5 seconds)
python3 dead_link_checker.py --interval 5s /path/to/markdown

Go Version (Recommended)

# Build
go build -o deadlink dead_link_checker.go

# GUI mode
./deadlink

# CLI mode
./deadlink /path/to/markdown

# Check only local file links
./deadlink --no-web /path/to/markdown

# Watch mode
./deadlink --interval 5s /path/to/docs

CLI Options

Flag Description Default
--web Check web URLs true
--no-web Skip web URL checking false
--file, --local Check local file links true
--no-file Skip local file link checking false
--timeout HTTP timeout in seconds 10
--rate-limit Rate limit between requests 0.1
--ignore Regex patterns to ignore -
--interval Watch mode refresh interval (e.g., 5s) -

Screenshots

GUI Mode

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  Dead Link Checker                       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Directory: [/path/to/markdown    ] [Browse...]          โ”‚
โ”‚                                                         โ”‚
โ”‚ โ˜‘ Check Web URLs  โ˜‘ Check Local Links                  โ”‚
โ”‚                                                         โ”‚
โ”‚ [Start] [Stop] [Clear] [Export]                        โ”‚
โ”‚                                                         โ”‚
โ”‚ Progress: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 65% (130/200)           โ”‚
โ”‚ Checking: README.md                                     โ”‚
โ”‚                                                         โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚ โ”‚ Results                                            โ”‚  โ”‚
โ”‚ โ”‚ SUMMARY                                            โ”‚  โ”‚
โ”‚ โ”‚ Total links: 150                                   โ”‚  โ”‚
โ”‚ โ”‚ Broken links: 5                                    โ”‚  โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

CLI Output

Scanning: /path/to/markdown
Mode: web=true, local=true

============================================================
SUMMARY
============================================================
Total links: 150
By type: {'local': 120, 'web': 25, 'anchor': 5}
By status: {'ok': 145, 'broken': 5}

โš ๏ธ  BROKEN LINKS (5):
------------------------------------------------------------
File                                     Line   Type     Status     URL
----------------------------------------------------------------------------------------------------
/Users/project/README.md                 42     local    broken     not_found: ./missing-file.md
/Users/project/docs/guide.md             18     web      broken     HTTP 404

Installation

Python

# Optional dependencies for better output
pip install httpx rich

Go

go get github.com/rivo/tview
go build -o deadlink dead_link_checker.go

Supported Link Types

Type Example Verified
Standard markdown [text](url) โœ…
Images ![alt](src) โœ…
Wiki/Obsidian [[page]] โœ…
HTML links <a href="url"> โœ…
Reference links [text][ref] โœ…
Anchors #section โš ๏ธ (not verified)

Performance

Metric Python Go
Startup ~200ms ~10ms
1000 files ~30s ~1.5s
Binary size N/A ~12MB

Examples

Check a project for broken links

./deadlink /path/to/project

Continuous monitoring during editing

./deadlink --interval 10s /path/to/docs

Export results for CI/CD

./deadlink --no-web /path/to/project
# Results saved to dead_link_report.json

Project Structure

deadlink/
โ”œโ”€โ”€ dead_link_checker.py      # Python version
โ”œโ”€โ”€ dead_link_checker.go      # Go version
โ”œโ”€โ”€ README.md                 # This file
โ””โ”€โ”€ LICENSE                   # MIT License

Why Two Versions?

  • Python: Quick scripting, easy to modify, familiar to most developers
  • Go: Single binary, 20x faster, no runtime dependencies, production-ready

Choose based on your needs - both have identical features!

Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Make your changes
  4. Submit a PR

License

MIT License - see LICENSE for details.

Related Projects


Made with โค๏ธ for maintaining clean documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

md_deadlink-0.1.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

md_deadlink-0.1.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page