setu scans your documentation, extracts links, and validates both local file paths and remote URLs concurrently so your docs never suffer from bit rot or broken pathways.
After working on countless projects that all use markdown I find myself running into the same issue, are all my links valid? A simple typo could redirect users to a dead website or a missing asset and these issues are often caught too late; in production.
Using cargo:
cargo install setu-cliUsage: setu-cli [OPTIONS] [TARGET_PATH]
Arguments:
[TARGET_PATH] [default: .]
Options:
-s, --strict
-h, --help Print help
-V, --version Print version
Use setu to scan the current directory in strict mode
setu-cli -sTo scan a different directory type its path:
setu-cli ./docsSetu treats remote URL's as OK if something is returned from them, even if thats a 404, because the site is still reachable.
You can flag specific response codes as concerns using the --concerns argument:
setu-cli --concerns 404,500For example under these rules:
404 - Faulty
401 - Valid
500 - Faulty
Outputs are categorised as Faulty or Invalid.
FAIL Faulty local link ./does_not_exist.png at ./tests/test.md | The local link does not exist
FAIL Faulty remote URL https://simulatehttpcode.vercel.app/statuscode?q=404 at ./tests/test.md | The URL returned an unsuccessful status code: 404 (note: this is with --concerns 404)
FAIL Invalid URL Empty URL at abc.md | Invalid Path
To use this as part of your CI see the workflow used by this repository.
When running setu-cli as part of your CI, you should run it in --strict mode to terminate the program with exit code 1.
This project is licensed under the MIT License