{"id":18977958,"url":"https://github.com/becheran/mlc","last_synced_at":"2025-05-15T20:07:23.040Z","repository":{"id":36866245,"uuid":"230644388","full_name":"becheran/mlc","owner":"becheran","description":"Check for broken links in markup files","archived":false,"fork":false,"pushed_at":"2025-04-18T19:56:53.000Z","size":1155,"stargazers_count":134,"open_issues_count":13,"forks_count":16,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T07:54:14.743Z","etag":null,"topics":["broken-links","checker","deadlinks","html","link","mark","markup","rust","rust-"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/becheran.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-28T17:59:26.000Z","updated_at":"2025-04-18T19:56:56.000Z","dependencies_parsed_at":"2024-05-29T17:31:48.291Z","dependency_job_id":"8227065c-3bd0-4cbd-b255-e73efd43a319","html_url":"https://github.com/becheran/mlc","commit_stats":{"total_commits":435,"total_committers":18,"mean_commits":"24.166666666666668","dds":0.5931034482758621,"last_synced_commit":"e6970d026408be89da36f5a8dc07b77d5b582735"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/becheran%2Fmlc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/becheran%2Fmlc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/becheran%2Fmlc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/becheran%2Fmlc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/becheran","download_url":"https://codeload.github.com/becheran/mlc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414499,"owners_count":22067272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["broken-links","checker","deadlinks","html","link","mark","markup","rust","rust-"],"created_at":"2024-11-08T15:31:35.060Z","updated_at":"2025-05-15T20:07:18.000Z","avatar_url":"https://github.com/becheran.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Markup Link Checker\n\n[![crates.io](https://img.shields.io/crates/v/mlc.svg?color=orange)](https://crates.io/crates/mlc)\n[![downloads](https://badgen.net/crates/d/mlc?color=blue)](https://crates.io/crates/mlc)\n[![build status](https://github.com/becheran/mlc/actions/workflows/rust.yml/badge.svg)](https://github.com/becheran/mlc/actions/workflows/rust.yml)\n[![license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit)\n[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/becheran/mlc/blob/master/CONTRIBUTING.md)\n\n![image](./docs/mlc.gif)\n\nCheck 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.\n\n## Features\n\n* Find and check links in `markdown` and `html` files\n* Validated absolute and relative file paths and URLs\n* User friendly command line interface\n* Easy [CI pipeline integration](#ci-pipeline-integration)\n* Very fast execution using [async rust](https://rust-lang.github.io/async-book/)\n* Efficient link resolving strategy which tries with minimized network load\n* Throttle option to prevent *429 Too Many Requests* errors\n* Report broken links via GitHub workflow commands\n\n## Install Locally\n\nThere are different ways to install and use *mlc*.\n\n### Cargo\n\nUse rust's package manager [cargo](https://doc.rust-lang.org/cargo/) to install *mlc* from [crates.io](https://crates.io/crates/mlc):\n\n``` bash\ncargo install mlc\n```\n\n### Download Binaries\n\nTo download a compiled binary version of *mlc* go to [github releases](https://github.com/becheran/mlc/releases) and download the binaries compiled for `linux` and `apple` and `windows`.\n\n### Arch Linux\n\nYou can install from the [official repositories](https://archlinux.org/packages/extra/x86_64/markuplinkchecker/) using [pacman](https://wiki.archlinux.org/title/Pacman):\n\n```bash\npacman -S markuplinkchecker\n```\n\n## CI Pipeline\n\n### GitHub Actions\n\nUse *mlc* in GitHub using the *GitHub-Action* from the [Marketplace](https://github.com/marketplace/actions/markup-link-checker-mlc).\n\n``` yaml\n- name: Markup Link Checker (mlc)\n  uses: becheran/mlc@v0.21.0\n```\n\nUse *mlc* command line arguments using the `with` argument:\n\n``` yaml\n- name: Markup Link Checker (mlc)\n  uses: becheran/mlc@v0.21.0\n  with:\n    args: ./README.md\n```\n\nThe action does uses [GitHub workflow commands](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions) to highlight broken links:\n\n![annotation](./docs/FailingAnnotation.PNG)\n\n### Binary\n\nTo integrate *mlc* in your CI pipeline running in a *linux x86_64 environment* you can add the following commands to download and execute it:\n\n``` bash\ncurl -L https://github.com/becheran/mlc/releases/download/v0.21.0/mlc-x86_64-linux -o mlc\nchmod +x mlc\n./mlc\n```\n\nFor example take a look at the [ntest repo](https://github.com/becheran/ntest/blob/master/.github/workflows/ci.yml) which uses *mlc* in the CI pipeline.\n\n## Docker\n\nUse the *mlc* docker image from the [docker hub](https://hub.docker.com/r/becheran/mlc) which includes *mlc*:\n\n``` sh\ndocker run becheran/mlc mlc\n```\n\n## Usage\n\nOnce 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:\n\n``` bash\nmlc\n```\n\nAnother example is to call *mlc* on a certain directory or file:\n\n``` bash\nmlc ./docs\n```\n\nAlternatively you may want to ignore all files currently ignored by `git` (requires `git` binary to be found on $PATH) and set a root-dir for relative links:\n\n```bash\nmlc --gitignore --root-dir .\n```\n\nCall *mlc* with the `--help` flag to display all available cli arguments:\n\n``` bash\nmlc -h\n```\n\nThe following arguments are available:\n\n| Argument         | Short | Description |\n|------------------|-------|-------------|\n| `\u003cdirectory\u003e`    |       | Only positional argument. Path to directory which shall be checked with all sub-dirs. Can also be a specific filename which shall be checked. |\n| `--help`         | `-h`  | Print help |\n| `--debug`        | `-d`  | Show verbose debug information |\n| `--do-not-warn-for-redirect-to` | | Do not warn for links which redirect to the given URL. Allows the same link format as `--ignore-links`. For example, `--do-not-warn-for-redirect-to \"http*://crates.io*\"` will not warn for links which redirect to the `crates.io` website. |\n| `--offline`      | `-o`  | Do not check any web links. Renamed from `--no-web-links` which is still an alias for downwards compatibility |\n| `--match-file-extension` | `-e`  | Set the flag, if the file extension shall be checked as well. For example the following markup link `[link](dir/file)` matches if for example a file called `file.md` exists in `dir`, but would fail when the `--match-file-extension` flag is set. |\n| `--version`      | `-V` | Print current version of mlc |\n| `--ignore-path`  | `-p` | Comma separated list of directories or files which shall be ignored. For example  |\n| `--gitignore`    | `-g` | Ignore all files currently ignored by git (requires `git` binary to be available on $PATH). |\n| `--gituntracked` | `-u` | Ignore all files currently untracked by git (requires `git` binary to be available on $PATH). |\n| `--ignore-links` | `-i` | Comma separated list of links which shall be ignored. Use simple `?` and `*` wildcards. For example `--ignore-links \"http*://crates.io*\"` will skip all links to the crates.io website. See the [used lib](https://github.com/becheran/wildmatch) for more information.  |\n| `--markup-types` | `-t` | Comma separated list list of markup types which shall be checked. Possible values: `md`, `html` |\n| `--root-dir`     | `-r` | All links to the file system starting with a slash on linux or backslash on windows will use another virtual root dir. For example the link in a file `[link](/dir/other/file.md)` checked with the cli arg `--root-dir /env/another/dir` will let *mlc* check the existence of `/env/another/dir/dir/other/file.md`. |\n| `--throttle`     | `-T` | Number of milliseconds to wait in between web requests to the same host. Default is zero which means no throttling. Set this if you need to slow down the web request frequency to avoid `429 - Too Many Requests` responses. For example with `--throttle 15`, between each http check to the same host, 15 ms will be waited. Note that this setting can slow down the link checker. |\n\nAll optional arguments which can be passed via the command line can also be configured via the `.mlc.toml` config file in the working directory:\n\n``` toml\n# Print debug information to console\ndebug = true\n# Do not warn for links which redirect to the given URL\ndo-not-warn-for-redirect-to=[\"http*://crates.io*\"]\n# Do not check web links\noffline = true\n# Check the exact file extension when searching for a file\nmatch-file-extension= true\n# List of files and directories which will be ignored\nignore-path=[\"./ignore-me\",\"./src\"]\n# Ignore all files ignored by git\ngitignore = true\n# List of links which will be ignored\nignore-links=[\"http://ignore-me.de/*\",\"http://*.ignoresub-domain/*\"]\n# List of markup types which shall be checked\nmarkup-types=[\"Markdown\",\"Html\"]\n# Wait time in milliseconds between http request to the same host\nthrottle= 100\n# Path to the root folder used to resolve all relative paths\nroot-dir=\"./\"\n```\n\n## Changelog\n\nCheckout the [changelog file](https://github.com/becheran/mlc/blob/master/CHANGELOG.md) to see the changes between different versions.\n\n## License\n\nThis project is licensed under the *MIT License* - see the [LICENSE file](https://github.com/becheran/mlc/blob/master/LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbecheran%2Fmlc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbecheran%2Fmlc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbecheran%2Fmlc/lists"}