mlc
mlc copied to clipboard
Check for broken links in markup files
Markup Link Checker
Check for broken links in markup files. Currently html and markdown files are supported. The Markup Link Checker can easily be integrated in your CI pipeline to prevent broken links in your markup docs.
Features
- Find and check links in
markdownandhtmlfiles - Support HTML links and plain URLs in
markdownfiles - Validated absolute and relative file paths and URLs
- User friendly command line interface
- Easy CI pipeline integration
- Very fast execution using async
- Efficient link resolving strategy which tries with minimized network load
- Throttle option to prevent 429 Too Many Requests errors
Install Locally
There are different ways to install and use mlc.
Cargo
Use rust's package manager cargo to install mlc from crates.io:
cargo install mlc
Download Binaries
To download a compiled binary version of mlc go to github releases and download the binaries compiled for x86_64-unknown-linux-gnu and x86_64-apple-darwin.
CI Pipeline Integration
GitHub Actions
Use mlc in GitHub using the GitHub-Action from the Marketplace.
- name: Markup Link Checker (mlc)
uses: becheran/[email protected]
Use mlc command line arguments using the with argument:
- name: Markup Link Checker (mlc)
uses: becheran/[email protected]
with:
args: ./README.md
Binary
To integrate mlc in your CI pipeline running in a linux x86_64 environment you can add the following commands to download the tool:
curl -L https://github.com/becheran/mlc/releases/download/v0.15.4/mlc -o mlc
chmod +x mlc
For example take a look at the ntest repo which uses mlc in the CI pipeline.
Docker
Use the mlc docker image from the docker hub which includes mlc.
Usage
Once you have mlc installed, it can be called from the command line. The following call will check all links in markup files found in the current folder and all subdirectories:
mlc
Another example is to call mlc on a certain directory or file:
mlc ./docs
Call mlc with the --help flag to display all available cli arguments:
mlc -h
See the reference for all available command line arguments.
Changelog
Checkout the changelog file to see the changes between different versions.
License
This project is licensed under the MIT License - see the LICENSE file for more details.