A static analyzer for documentation link integrity in Markdown-based repositories. The tool detects broken links, orphan files, missing anchors, and circular dependencies, generating reports in Markdown, HTML, or JSON formats for CI/CD integration.
| Feature | Description |
|---|---|
| File Scanning | Recursive traversal of .md and .markdown files with pattern-based exclusions. |
| Graph Analysis | Builds a directed connectivity graph to detect structural issues. |
| Validation Rules | Checks for broken links, orphan files, missing anchors, and circular dependencies. |
| Reporting | Generates CLI, Markdown, HTML, and JSON reports for CI/CD integration. |
| AsciiDoc Support | Basic parsing of .adoc and .asc files (link macros, cross-references, images). |
CI/CD Integration Guide
Developer Guide
Specification
Architecture Details
For detailed information about current limitations and their impact, see docs/specification.md#known-limitations.
Key points:
- AsciiDoc support is basic (regex-based, no complex macros)
- External link validation uses conservative classification (WARNING for ambiguous status codes)
- Anchor validation covers Markdown headers only (no HTML anchors in Markdown files)
- Performance is optimized for CI/CD (changed files only), not full repository scans
- Python 3.13 or higher.
Install docs-validator directly into the target project that requires documentation link validation. This ensures seamless integration with the project's CI/CD pipeline and local development environment.
cd ~/projects/project_to_validate/
python3 -m venv .venv
source .venv/bin/activate
pip install git+https://github.com/Nokhrin/docs-validator.git
docs-validator --helpdocs-validator scan ./docsdocs-validator scan ./docs --report markdown --output /tmp/report.mddocs-validator scan ./docs --report html --output /tmp/report.htmldocs-validator scan ./docs --validate --fail-on-errorBy default, the tool looks for the .docs-validator.toml file in the root directory of the project being scanned. Alternatively, you can specify a custom path using the --config flag.
Example .docs-validator.toml:
cat > .docs-validator.toml << 'EOF'
[validator]
path_to_explore = './docs'
exclude_patterns = ['.git', 'node_modules', '*.tmp']
log_level = 'warning'
report_format = 'markdown'
is_validate = true
is_fail_on_error = true
external_timeout_sec = 10
max_threads_number = 5
hosts_to_ignore = ['localhost', '127.0.0.1']
is_skip_external = false
EOFRun (automatically uses .docs-validator.toml from the current directory):
docs-validator scanRun with a custom configuration path:
docs-validator scan --config /path/to/custom-config.tomldocs-validator scan ./docs --skip-externalNote: The hook requires dependencies from
[dev]extras. Install them with:pip install -e ".[dev]"
Create the hook file .githooks/pre-commit
Example
# setup
chmod +x .githooks/pre-commit
git config core.hooksPath .githooks
# verify
bash .githooks/pre-commit