Tool for finding broken references and links in Markdown files.
Project description
RefCheck
RefCheck is a simple tool for finding broken references and links in Markdown files.
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)
:construction: RefCheck is still in its development. If you encounter any issues or have suggestions, feel free to open an issue or pull request.
Installation
RefCheck is available on PyPI:
pip install refcheck
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
====================================================================
Features
- Find and check various reference patterns in Markdown files
- Highlight broken references
- Validate absolute and relative file paths to any file type
- Support for checking remote references, such as [Google](https://www.google.com)
- User friendly CLI
- Easy CI pipeline integration - perfect for ensuring the quality of your Wiki
Pre-commit Hook
RefCheck is also available as pre-commit hook!
repos:
- repo: <https://github.com/flumi3/refcheck>
rev: v0.3.0
hooks:
- id: refcheck
args: ["docs/", "-e", "docs/filetoexclude.md"] # (optional) configure refcheck like this
Contributing
Getting Started
-
Install Poetry
pipx install poetry
-
Make Poetry install virtual environments in project root
poetry config virtualenvs.in-project true
-
Install dependencies
poetry install -
Run refcheck
poetry run refcheck
Use Poetry for publishing to PyPI
-
Create an API token for authenticating to the PyPI project.
-
Configure Poetry to authenticate with PyPI:
poetry config pypi-token.pypi YOUR_PYPI_API_TOKEN
-
Build the package:
Poetry build -
Publish to PyPI:
Poetry publish
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.3.0.tar.gz.
File metadata
- Download URL: refcheck-0.3.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.11.9 Linux/5.15.167.4-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62e47ff9f5494a01267d4dd420ae62ad71c0680469f822f0aa5354e02840f74d
|
|
| MD5 |
918fd38821cc9f4ee8bcc124f85279e7
|
|
| BLAKE2b-256 |
52ac3258c4aa6d1d4e3d26c9f7c7a6ad33cbd2a36fac3a255b7da505ef5a2280
|
File details
Details for the file refcheck-0.3.0-py3-none-any.whl.
File metadata
- Download URL: refcheck-0.3.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.11.9 Linux/5.15.167.4-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63daa6466d0c677b44bd655055abd3ea3358edeeba73a7eff30fba0ee8e51ee2
|
|
| MD5 |
4690a1ce445dee29bd82747703eb299a
|
|
| BLAKE2b-256 |
12805b080d9ec648dccda6f34e3fbc184b2e497c7ee89f194a521bd0a228fde4
|