Documentation
¶
Overview ¶
checklinks is a link-checking tool for the resticprofile documentation.
It scans all files in the current directory tree (skipping common non-doc directories) for URLs that begin with the configured source base URL, then verifies that every discovered URL returns a successful HTTP response.
When checking links, the tool can operate in two modes:
Local mode (default): starts an in-process HTTPS server that serves the compiled documentation from a local directory, then checks all links against that server. Use -dir to point at the directory.
Remote mode: redirects all requests to an alternative base URL supplied via -target. Useful for smoke-testing a staging deployment without rewriting every link in the source files.
In addition to checking HTTP status codes, the tool validates URL fragments (e.g. /page#section) by searching the response body for the corresponding id="…" attribute, so broken anchors are caught as well.
Usage:
checklinks [-v] [-source <url>] [-target <url>] [-dir <path>]
Flags:
-v Print each link as it is discovered (verbose output).
-source Base URL whose occurrences are searched for in files.
Defaults to https://creativeprojects.github.io/resticprofile.
-target Alternative base URL to send requests to. When omitted, a
local server is started and -dir must be provided.
-dir Directory containing the compiled HTML documentation.
Required when -target is not specified.