Documentation Development Guide¶
Document Version: 1.0.2
Last Updated: 2026-05-21
Git Commit: 61384b4a
Author: Lincoln
This directory contains the complete documentation for the JAiRouter project.
Documentation Management Tools¶
We provide unified documentation management scripts that integrate document serving, link checking, version management, and other features.
Requirements¶
- Python 3.x
- pip (Python package manager)
- PowerShell (Windows) or Bash (Linux/macOS)
Unified Management Scripts¶
Choose the script corresponding to your operating system:
- Windows PowerShell:
scripts\docs\docs-manager.ps1 - Windows Batch:
scripts\docs\docs-manager.cmd - Linux/macOS:
scripts/docs/docs-manager.sh
Quick Start¶
Starting the Documentation Server¶
# Windows PowerShell
.\scripts\docs\docs-manager.ps1 serve
# Windows Batch
.\scripts\docs\docs-manager.cmd serve
# Linux/macOS
./scripts/docs/docs-manager.sh serve
# Custom port and address
.\scripts\docs\docs-manager.ps1 serve -HostAddress 0.0.0.0 -Port 3000
./scripts/docs/docs-manager.sh serve --host 0.0.0.0 --port 3000
Checking Documentation Links¶
# Check all links
.\scripts\docs\docs-manager.ps1 check-links
# Output report to file
.\scripts\docs\docs-manager.ps1 check-links -Output report.json
# Exit with code 1 when issues are found
.\scripts\docs\docs-manager.ps1 check-links -FailOnError
Fixing Broken Links¶
# Analyze and display fix suggestions
.\scripts\docs\docs-manager.ps1 fix-links
# Apply fix suggestions (interactive confirmation)
.\scripts\docs\docs-manager.ps1 fix-links -Apply
# Auto-fix without asking for confirmation
.\scripts\docs\docs-manager.ps1 fix-links -Apply -AutoFix
Version Management¶
# Scan and update document versions
.\scripts\docs\docs-manager.ps1 version -Scan
# Add version header information
.\scripts\docs\docs-manager.ps1 version -AddHeaders
# Export version data
.\scripts\docs\docs-manager.ps1 version -Export data.json
# Clean up change records older than 90 days
.\scripts\docs\docs-manager.ps1 version -Cleanup 90
Validating Documentation Structure¶
Checking Documentation Synchronization¶
# Check synchronization between docs and code
.\scripts\docs\docs-manager.ps1 check-sync
# Output report to file
.\scripts\docs\docs-manager.ps1 check-sync -Output sync-report.md
Legacy Method (Manual Execution)¶
If you prefer to execute each step manually:
# Install dependencies
pip install -r requirements.txt
# Start development server
mkdocs serve
# Build static files
mkdocs build
Linux/macOS Users¶
# Start documentation service using the Shell script
./scripts/docs/docs-manager.sh serve
# Or execute manually
pip3 install -r requirements.txt
mkdocs serve
Available Commands¶
serve - Start Documentation Server¶
Starts the local development server with hot-reload support.
Options: - --host <address>: Listening address (default: localhost) - --port <port>: Listening port (default: 8000)
Example:
check-links - Check Link Validity¶
Checks all links in the documentation, including internal and external links.
Options: - --output <file>: Output report file path - --fail-on-error: Exit with code 1 when broken links are found
Example:
fix-links - Fix Broken Links¶
Based on the link check report, provides fix suggestions and automatic fix capabilities.
Options: - --apply: Apply fix suggestions - --auto-fix: Auto-fix without asking for confirmation
Example:
version - Version Management¶
Manages document version information and tracks document changes.
Options: - --scan: Scan and update version information - --add-headers: Add version header information to documents - --cleanup <days>: Clean up change records older than specified days - --export <file>: Export version data to file - --check-outdated <days>: Days threshold for checking outdated documents
Example:
check-sync - Check Synchronization¶
Checks the synchronization between documentation content and code, verifying the accuracy of configuration examples and API documentation.
Options: - --output <file>: Output report file path - --fail-on-error: Exit with code 1 when critical issues are found
Example:
validate - Validate Documentation¶
Validates the documentation structure and MkDocs configuration file correctness.
Example:
Documentation Structure¶
docs/
├── zh/ # Chinese documentation
│ ├── index.md # Homepage
│ ├── getting-started/ # Getting Started
│ ├── configuration/ # Configuration Guide
│ ├── api-reference/ # API Reference
│ ├── deployment/ # Deployment Guide
│ ├── monitoring/ # Monitoring Guide
│ ├── development/ # Development Guide
│ ├── troubleshooting/ # Troubleshooting
│ └── reference/ # Reference Materials
├── en/ # English documentation
│ └── (same structure as Chinese)
├── assets/ # Static assets
├── CNAME # GitHub Pages domain configuration
└── README.md # This file
Development Workflow¶
Start the Development Server
Edit Documentation Content
- Edit Markdown files in the corresponding language directory
Auto-reload on save
Check Link Validity
Fix Discovered Issues
Update Version Information
Validate Documentation Structure
Deployment¶
Documentation is automatically deployed to GitHub Pages via GitHub Actions. Every push to the main branch automatically triggers a build and deployment.
Manual Deployment¶
To deploy manually:
Contributing Guide¶
- Create a feature branch
- Edit documentation content
- Run documentation check tools
- Submit a Pull Request
Documentation Writing Standards¶
- Use Markdown format
- Use Chinese punctuation for Chinese documentation
- Use English punctuation for English documentation
- Specify language type for code blocks
- Use relative paths for links
- Place images in the
assets/directory
Quality Checks¶
Before submitting, please run the following checks:
# Check link validity
.\scripts\docs\docs-manager.ps1 check-links -FailOnError
# Check documentation synchronization
.\scripts\docs\docs-manager.ps1 check-sync -FailOnError
# Validate documentation structure
.\scripts\docs\docs-manager.ps1 validate
Troubleshooting¶
Common Issues¶
- Python dependency installation fails
- Ensure Python 3.x is installed
- Try using
pip3instead ofpip Check network connection
MkDocs server fails to start
- Check
mkdocs.ymlconfiguration file syntax - Ensure all navigation files exist
Run
.\scripts\docs\docs-manager.ps1 validateto check configurationLink check fails
- Check network connection
- Some external links may have anti-scraping protection
For internal links, verify that file paths are correct
Script execution permission issues (Linux/macOS)
Getting Help¶
If you encounter issues, you can:
View script help information:
Check project Issues
- Contact project maintainers
Changelog¶
- v1.1.0 (2025-08-18): Integrated documentation management scripts, simplified usage workflow
- v1.0.0 (2025-08-18): Initial version, basic documentation structure