This is a lightweight and fast tool to help you keep your Markdown files free of broken links.
Project description
Markdown dead link checker
This is a lightweight and fast tool to help you keep your Markdown files free of broken links! It scans your Markdown files and verifies whether each link is still active, letting you know if any need attention.
Detection issues
- Unavailable web links.
- Incorrect links to file.
- Not existed fragments in markdown, like
[no-fragment](README.md#no-fragment)
.
Example of output for fail.md
File: tests/test_md_files/fail.md:3 • Link: https://github.com/AlexanderDokuchaev/FAILED • Error: 404: Not Found
File: tests/test_md_files/fail.md:4 • Link: https://not_exist_github.githubcom/ • Error: 500: Internal Server Error
File: tests/test_md_files/fail.md:8 • Link: /test/fail.md1 • Error: Path does not exist
File: tests/test_md_files/fail.md:9 • Link: fail.md1 • Error: Path does not exist
File: tests/test_md_files/fail.md:13 • Link: a.md#fail • Error: Not found fragment
❌ Found 5 dead links 🙀
Usage
Github action
jobs:
md-dead-link-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: AlexanderDokuchaev/md-dead-link-check@main
Pre-commit hook
Adding to your .pre-commit-config.yaml
- repo: https://github.com/AlexanderDokuchaev/md-dead-link-check
rev: main
hooks:
- id: md-dead-link-check
Install rom pip
pip install md-dead-link-check
md-dead-link-check
Install github repo
git clone https://github.com/AlexanderDokuchaev/md-dead-link-check
cd md-dead-link-check
pip install .
md-dead-link-check
Configuration
By default use pyproject.toml
, to use another config toml file use --config
.
- timeout - timeout to response web link, defaults
10
. - exclude_links - disable fails for links, defaults
[]
. - exclude_files - disable check for file, defaults
[]
. - check_web_links - to disable check web links, defaults
true
.
[tool.md_dead_link_check]
timeout = 10
exclude_links = ["https://github.com/"]
exclude_files = ["tests/test_md_files/fail.md"]
check_web_links = true
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_dead_link_check-0.2.tar.gz
(11.9 kB
view details)
Built Distribution
File details
Details for the file md_dead_link_check-0.2.tar.gz
.
File metadata
- Download URL: md_dead_link_check-0.2.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c95f612d396e84e8209f9d9a5218cca49aab598d67a99c39a3a87677a7b94140 |
|
MD5 | 06a2e7b70a46a727ba2f8079a2336a1a |
|
BLAKE2b-256 | 594614f309366173a62e05495fdf3c7531fbd6f108a22f1f7f23e68f6fb9d51c |
File details
Details for the file md_dead_link_check-0.2-py3-none-any.whl
.
File metadata
- Download URL: md_dead_link_check-0.2-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 194f9436df5f7ef085d73b09c2e31afa438507832ace7ece537738f7fed973ea |
|
MD5 | d1fd836033d2b685d4b61770d2e0e156 |
|
BLAKE2b-256 | 8693af9c4713f70f9bf6317b4486eaaff6e8aaea777e59326f427b627385e08f |