Quick Start
Validate a Directory
Section titled “Validate a Directory”The most common usage is to validate all code blocks in your project:
md-go-validator .This scans all .md, .markdown, and .mdx files recursively and validates Go code blocks by default.
Validate Specific Files
Section titled “Validate Specific Files”md-go-validator README.md docs/Multiple Languages
Section titled “Multiple Languages”# Validate Go and TypeScriptmd-go-validator -l go,typescript .
# Validate all supported languagesmd-go-validator -l go,templ,typescript,nix,rust,hcl .CI Integration
Section titled “CI Integration”Add to your GitHub Actions workflow:
name: Validate Docson: [push, pull_request]jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 - run: go install github.com/larsartmann/md-go-validator@latest - run: md-go-validator -f json -o results.json .Pipe via STDIN
Section titled “Pipe via STDIN”cat README.md | md-go-validator -Output Formats
Section titled “Output Formats”md-go-validator -f table . # Default: human-readable tablemd-go-validator -f json . # JSON for CI integrationmd-go-validator -f sarif . # SARIF for GitHub Code Scanningmd-go-validator -f quiet . # Summary only, no code in errorsNext Steps
Section titled “Next Steps”- Learn about CLI Options
- Understand Go Parsing Strategies
- Set up CI Integration