Skip to main content

Tool for finding broken references and links in Markdown files.

Project description

Markdown RefCheck

PyPI Downloads Python License: MIT CI/CD

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 - 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
  • 💬 Inline Ignore Comments - Suppress false positives with <!-- refcheck-ignore --> directives

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.5.0
  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:

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

refcheck-0.5.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

refcheck-0.5.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file refcheck-0.5.0.tar.gz.

File metadata

  • Download URL: refcheck-0.5.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for refcheck-0.5.0.tar.gz
Algorithm Hash digest
SHA256 47938d7dcab7f9dbb9029b7b11e107828749190958dcb11fe7a29c3a0aed7e9c
MD5 d60956f9c4d6caf58a7774cecbd25d81
BLAKE2b-256 2877241605467d09f8b9f5408fecf0cb465984db3ee3444a46438db179deedfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for refcheck-0.5.0.tar.gz:

Publisher: ci-cd.yml on flumi3/markdown-refcheck

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file refcheck-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: refcheck-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for refcheck-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6abcfacc5869cdfbb28c3320a45d5c79a359c43be6057f97bf7d5e8fab88d8a8
MD5 735f445c20af30af17b5a7ad9c054c81
BLAKE2b-256 fc189d73eb12bbe458caa89fa504066c2c4ca609b60a52d50f5577419d96e84d

See more details on using hashes here.

Provenance

The following attestation bundles were made for refcheck-0.5.0-py3-none-any.whl:

Publisher: ci-cd.yml on flumi3/markdown-refcheck

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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