Clean Docs¶
Documentation quality CLI - Validate code snippets, detect broken links, auto-fix issues, and integrate with CI/CD.
-
Code Snippet Validation
Validate that code examples in your docs match actual source code using tree-sitter parsing.
-
Link Checking
Check internal files, external URLs, GitHub repos, and anchors for broken links.
-
Auto-fixing
Automatically fix outdated snippets, missing extensions, anchor typos, and case issues.
-
CI/CD Ready
JSON/Markdown output, GitHub annotations, and proper exit codes for automation.
Quick Start¶
Installation¶
# Via pip (recommended)
pip install clean-docs # Core features
pip install 'clean-docs[snippets]' # + Code snippet validation
pip install 'clean-docs[snippets,semantic]' # All features
# Or via curl installer
curl -fsSL https://raw.githubusercontent.com/Algiras/clean-docs/main/install.sh | bash
Basic Usage¶
# Check your setup
clean-docs doctor
# Scan for broken links
clean-docs scan ./docs
# Validate code snippets
clean-docs validate-snippets ./docs --code-dir ./src
# Auto-fix issues
clean-docs scan ./docs --fix --yes
Why Clean Docs?¶
Documentation quality degrades over time. Code changes but examples don't get updated. Links break. Clean Docs helps you:
- Catch outdated code examples before users do
- Find broken links across your entire documentation
- Automate fixes to reduce manual work
- Integrate with CI to prevent regressions
Supported Languages¶
For code snippet validation, clean-docs supports:
| Language | Extensions |
|---|---|
| Python | .py |
| Java | .java |
| Scala | .scala |
| TypeScript | .ts, .tsx |
| JavaScript | .js, .jsx |
| Go | .go |
| Rust | .rs |
| Bazel | BUILD, BUILD.bazel, .bzl |
License¶
MIT License - see LICENSE.