Tool for finding broken references and links in Markdown files.
Project description
Markdown RefCheck
Markdown RefCheck is a simple tool that checks Markdown references to find any broken links.
It helps keeping your documentation free from broken section refs, missing images and files, and unavailable websites links.
usage: refcheck [OPTIONS] [PATH ...]
positional arguments:
PATH Markdown files or directories to check
options:
-h, --help show this help message and exit
-e, --exclude [ ...] Files or directories to exclude
-cm, --check-remote Check remote references (HTTP/HTTPS links)
-nc, --no-color Turn off colored output
-v, --verbose Enable verbose output
--allow-absolute Allow absolute path references like [ref](/path/to/file.md)
Features
- 🔍 Reference Detection - Find and validate various reference patterns in Markdown files
- ❌ Broken Link Highlighting - Quickly identify broken references with clear error messages
- 🌐 Remote URL Checking - Validate external HTTP/HTTPS links (optional with
--check-remote) - 🛠️ User-Friendly CLI - Simple and intuitive command-line interface
- 🎨 Colored Output - Clear, color-coded results for easy scanning (disable with
--no-color) - ⚙️ CI/CD Ready - Perfect for automated quality checks in your documentation workflows
- 🚀 Pre-commit Integration - Available as a pre-commit hook for automated validation
Installation
RefCheck is available on PyPI:
pip install refcheck
# or using pipx
pipx install refcheck
Pre-commit Integration
Add this to your pre-commit-config.yml:
- repo: https://github.com/flumi3/refcheck
rev: v0.4.4
hooks:
- id: refcheck
args: ["docs/", "--exclude", "docs/filetoexclude.md"]
Examples
$ refcheck README.md
[+] 1 Markdown files to check.
- README.md
[+] FILE: README.md...
README.md:3: #introduction - OK
README.md:5: #installation - OK
README.md:6: #getting-started - OK
Reference check complete.
============================| Summary |=============================
🎉 No broken references!
====================================================================
$ refcheck . --check-remote
[+] Searching for markdown files in C:\Users\flumi3\github\refcheck ...
[+] 2 Markdown files to check.
- tests\sample_markdown.md
- docs\Understanding-Markdown-References.md
[+] FILE: tests\sample_markdown.md...
tests\sample_markdown.md:39: /img/image.png - BROKEN
tests\sample_markdown.md:52: https://www.openai.com/logo.png - BROKEN
[+] FILE: docs\Understanding-Markdown-References.md...
docs\Understanding-Markdown-References.md:42: #local-file-references - OK
Reference check complete.
============================| Summary |=============================
[!] 2 broken references found:
tests\sample_markdown.md:39: /img/image.png
tests\sample_markdown.md:52: https://www.openai.com/logo.png
====================================================================
For more advanced configuration options, see the Integration Guide.
Contributing
Contributions are welcome!
Please see CONTRIBUTING.md before opening pull requests.
Documentation
For more detailed information, check out the documentation:
- CLI Reference - Complete command-line options and usage
- Integration Guide - CI/CD and workflow integration
- Examples - Real-world usage examples
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file refcheck-0.4.4.tar.gz.
File metadata
- Download URL: refcheck-0.4.4.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
275b5f45f8de780f8359f8524dca4fe79b3a492116a186a414e9812d3baa9dcc
|
|
| MD5 |
68c57005b5114d51c665bb827fa9b48e
|
|
| BLAKE2b-256 |
0d1f2acbaa2b9d37560cfe4b2e265c723c5ef932b8b2a14044dda268e4dcc6b4
|
Provenance
The following attestation bundles were made for refcheck-0.4.4.tar.gz:
Publisher:
ci-cd.yml on flumi3/markdown-refcheck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
refcheck-0.4.4.tar.gz -
Subject digest:
275b5f45f8de780f8359f8524dca4fe79b3a492116a186a414e9812d3baa9dcc - Sigstore transparency entry: 1260647478
- Sigstore integration time:
-
Permalink:
flumi3/markdown-refcheck@39d236bec7ba3dbd2a4b4667a9c92f7468e43275 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/flumi3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@39d236bec7ba3dbd2a4b4667a9c92f7468e43275 -
Trigger Event:
push
-
Statement type:
File details
Details for the file refcheck-0.4.4-py3-none-any.whl.
File metadata
- Download URL: refcheck-0.4.4-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19d2a70b759ebc7e86c8d00b7c3fdc89fad5789b91c8d9e096888e202e30a483
|
|
| MD5 |
b5bbf164d66fbf91fc8e74c4d1d56d99
|
|
| BLAKE2b-256 |
e7a5448694b166ddb348597a755a467a693406316fc2c823c897e9722876d018
|
Provenance
The following attestation bundles were made for refcheck-0.4.4-py3-none-any.whl:
Publisher:
ci-cd.yml on flumi3/markdown-refcheck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
refcheck-0.4.4-py3-none-any.whl -
Subject digest:
19d2a70b759ebc7e86c8d00b7c3fdc89fad5789b91c8d9e096888e202e30a483 - Sigstore transparency entry: 1260647492
- Sigstore integration time:
-
Permalink:
flumi3/markdown-refcheck@39d236bec7ba3dbd2a4b4667a9c92f7468e43275 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/flumi3
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@39d236bec7ba3dbd2a4b4667a9c92f7468e43275 -
Trigger Event:
push
-
Statement type: