-
Notifications
You must be signed in to change notification settings - Fork 461
USAGE
Your GitHub wiki has broken internal links. This validation system helps you find and fix them before committing.
cd /path/to/wiki
python3 scripts/validate-wiki-links.pyThis will show all broken links in your markdown files.
Common issue: Links include directory prefixes that shouldn't be there.
# ❌ Wrong (includes directory in link name)
[Quick Start](Quick-Start)
[API Overview](API-Overview)
[FlowSpec](FlowSpec-Overview)
# ✅ Correct (just the file name)
[Quick Start](Quick-Start)
[API Overview](API-Overview)
[FlowSpec](FlowSpec-Overview)Why? GitHub wiki links use the file name only, not the directory path.
Option A: Auto-fix (recommended for bulk changes)
# Preview what will change
python3 scripts/fix-wiki-links.py --dry-run
# Apply the fixes
python3 scripts/fix-wiki-links.pyOption B: Manual fix Edit the markdown files based on the validator output.
python3 scripts/validate-wiki-links.pyShould show: ✅ All wiki links are valid!
git add .
git commit -m "Fix wiki links"The pre-commit hook will automatically validate before allowing the commit.
Your wiki has this structure:
wiki/
├── API/
│ ├── API-Commands.md
│ └── API-Overview.md
├── Getting-Started/
│ └── Quick-Start.md
└── Use-Cases/
└── DDoS-Mitigation.md
Link to these files like this:
[API Commands](API-Commands) # ✅ Just the filename
[Quick Start](Quick-Start) # ✅ Just the filename
[DDoS Mitigation](DDoS-Mitigation) # ✅ Just the filenameNOT like this:
[API Commands](API-Commands) # ❌ No paths
[Quick Start](Quick-Start) # ❌ No directory prefix
[DDoS Mitigation](DDoS-Mitigation) # ❌ No paths[API Overview](API-Overview) # ✅ No extension
[API Overview](API-Overview.md) # ❌ Don't include .md# Header: "API Overview"
[Link](#api-overview) # ✅ Lowercase, spaces → hyphens
# Header: "Getting Started (v5)"
[Link](#getting-started-v5) # ✅ Parentheses removedThe pre-commit hook runs automatically when you git commit.
If it blocks your commit:
- Read the error message to see which links are broken
- Fix those links
- Try committing again
To bypass (not recommended):
git commit --no-verifyProblem: [Text](Page-Name) but Page-Name.md doesn't exist.
Solutions:
- Check actual file name:
find . -name "*Page*" - Remove directory prefixes from link
- Check for typos
Problem: [Text](Page#section) but Page.md doesn't have that header.
Solutions:
- Check exact header text in target file
- Remember GitHub converts to lowercase and replaces spaces
- This is a WARNING, not an ERROR (won't block commits)
Problem: Hook doesn't run on commit.
Solutions:
# Make hook executable
chmod +x .git/hooks/pre-commit
# Verify it exists
ls -la .git/hooks/pre-commit
# Test manually
.git/hooks/pre-commit_Sidebar.md:
- [Quick Start](Quick-Start) # ❌ Wrong
- [API Overview](API-Overview) # ❌ Wrong
- [FlowSpec](FlowSpec-Overview) # ❌ Wrong_Sidebar.md:
- [Quick Start](Quick-Start) # ✅ Correct
- [API Overview](API-Overview) # ✅ Correct
- [FlowSpec](FlowSpec-Overview) # ✅ Correct- Run validator to see all errors:
python3 scripts/validate-wiki-links.py - Check
scripts/README.mdfor detailed documentation - File an issue on GitHub
Remember: GitHub wikis are flat - they don't use directory paths in links, only file names!
Getting Started
Configuration
- Configuration Syntax
- Neighbor Configuration
- Directives A-Z
- Templates
- Environment Variables
- Process Configuration
API
- API Overview
- Text API Reference
- JSON API Reference
- API Commands
- Writing API Programs
- Error Handling
- Production Best Practices
Address Families
- Overview
- IPv4 Unicast
- IPv6 Unicast
- FlowSpec
- EVPN
- L3VPN
- BGP-LS
- VPLS
- SRv6 / MUP
- Multicast
- RT Constraint
Features
Use Cases
Tools
Operations
Reference
- Architecture
- Design
- Attribute Reference
- Command Reference
- BGP State Machine
- Capabilities
- Communities
- Examples Index
- Glossary
- RFC Support
Integration
Migration
Community
External