Initial commit: loc_az_hci (smom-dbis-138 excluded via .gitignore)
Some checks failed
Test / test (push) Has been cancelled
Some checks failed
Test / test (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
149
scripts/docs/generate-docs-index.sh
Executable file
149
scripts/docs/generate-docs-index.sh
Executable file
@@ -0,0 +1,149 @@
|
||||
#!/bin/bash
|
||||
source ~/.bashrc
|
||||
# Generate Documentation Index
|
||||
# Auto-generates docs/INDEX.md from directory structure
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
DOCS_DIR="$PROJECT_ROOT/docs"
|
||||
INDEX_FILE="$DOCS_DIR/INDEX.md"
|
||||
|
||||
# Colors
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
log_info() {
|
||||
echo -e "${GREEN}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
log_step() {
|
||||
echo -e "${BLUE}[STEP]${NC} $1"
|
||||
}
|
||||
|
||||
generate_index() {
|
||||
log_info "Generating documentation index..."
|
||||
|
||||
cat > "$INDEX_FILE" << 'EOF'
|
||||
# Documentation Index
|
||||
|
||||
This is the master index for all project documentation. Documentation is organized by purpose to make it easy to find what you need.
|
||||
|
||||
**Note**: This index is auto-generated. Run `./scripts/docs/generate-docs-index.sh` to regenerate.
|
||||
|
||||
EOF
|
||||
|
||||
# Getting Started
|
||||
if [ -d "$DOCS_DIR/getting-started" ]; then
|
||||
echo "## Getting Started" >> "$INDEX_FILE"
|
||||
echo "" >> "$INDEX_FILE"
|
||||
for file in "$DOCS_DIR/getting-started"/*.md; do
|
||||
if [ -f "$file" ]; then
|
||||
title=$(basename "$file" .md | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1')
|
||||
filename=$(basename "$file")
|
||||
echo "- [$title](getting-started/$filename)" >> "$INDEX_FILE"
|
||||
fi
|
||||
done
|
||||
echo "" >> "$INDEX_FILE"
|
||||
fi
|
||||
|
||||
# Architecture
|
||||
if [ -d "$DOCS_DIR/architecture" ]; then
|
||||
echo "## Architecture" >> "$INDEX_FILE"
|
||||
echo "" >> "$INDEX_FILE"
|
||||
for file in "$DOCS_DIR/architecture"/*.md; do
|
||||
if [ -f "$file" ]; then
|
||||
title=$(basename "$file" .md | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1')
|
||||
filename=$(basename "$file")
|
||||
echo "- [$title](architecture/$filename)" >> "$INDEX_FILE"
|
||||
fi
|
||||
done
|
||||
echo "" >> "$INDEX_FILE"
|
||||
fi
|
||||
|
||||
# Deployment
|
||||
if [ -d "$DOCS_DIR/deployment" ]; then
|
||||
echo "## Deployment" >> "$INDEX_FILE"
|
||||
echo "" >> "$INDEX_FILE"
|
||||
for file in "$DOCS_DIR/deployment"/*.md; do
|
||||
if [ -f "$file" ]; then
|
||||
title=$(basename "$file" .md | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1')
|
||||
filename=$(basename "$file")
|
||||
echo "- [$title](deployment/$filename)" >> "$INDEX_FILE"
|
||||
fi
|
||||
done
|
||||
echo "" >> "$INDEX_FILE"
|
||||
fi
|
||||
|
||||
# Operations
|
||||
if [ -d "$DOCS_DIR/operations" ]; then
|
||||
echo "## Operations" >> "$INDEX_FILE"
|
||||
echo "" >> "$INDEX_FILE"
|
||||
for file in "$DOCS_DIR/operations"/*.md; do
|
||||
if [ -f "$file" ]; then
|
||||
title=$(basename "$file" .md | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1')
|
||||
filename=$(basename "$file")
|
||||
echo "- [$title](operations/$filename)" >> "$INDEX_FILE"
|
||||
fi
|
||||
done
|
||||
if [ -d "$DOCS_DIR/operations/runbooks" ]; then
|
||||
echo "- [Runbooks](operations/runbooks/)" >> "$INDEX_FILE"
|
||||
fi
|
||||
echo "" >> "$INDEX_FILE"
|
||||
fi
|
||||
|
||||
# Troubleshooting
|
||||
if [ -d "$DOCS_DIR/troubleshooting" ]; then
|
||||
echo "## Troubleshooting" >> "$INDEX_FILE"
|
||||
echo "" >> "$INDEX_FILE"
|
||||
for file in "$DOCS_DIR/troubleshooting"/*.md; do
|
||||
if [ -f "$file" ]; then
|
||||
title=$(basename "$file" .md | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1')
|
||||
filename=$(basename "$file")
|
||||
echo "- [$title](troubleshooting/$filename)" >> "$INDEX_FILE"
|
||||
fi
|
||||
done
|
||||
echo "" >> "$INDEX_FILE"
|
||||
fi
|
||||
|
||||
# Security
|
||||
if [ -d "$DOCS_DIR/security" ]; then
|
||||
echo "## Security" >> "$INDEX_FILE"
|
||||
echo "" >> "$INDEX_FILE"
|
||||
for file in "$DOCS_DIR/security"/*.md; do
|
||||
if [ -f "$file" ]; then
|
||||
title=$(basename "$file" .md | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1')
|
||||
filename=$(basename "$file")
|
||||
echo "- [$title](security/$filename)" >> "$INDEX_FILE"
|
||||
fi
|
||||
done
|
||||
echo "" >> "$INDEX_FILE"
|
||||
fi
|
||||
|
||||
# Reference
|
||||
if [ -d "$DOCS_DIR/reference" ]; then
|
||||
echo "## Reference" >> "$INDEX_FILE"
|
||||
echo "" >> "$INDEX_FILE"
|
||||
for file in "$DOCS_DIR/reference"/*.md; do
|
||||
if [ -f "$file" ]; then
|
||||
title=$(basename "$file" .md | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1')
|
||||
filename=$(basename "$file")
|
||||
echo "- [$title](reference/$filename)" >> "$INDEX_FILE"
|
||||
fi
|
||||
done
|
||||
echo "" >> "$INDEX_FILE"
|
||||
fi
|
||||
|
||||
log_info "Documentation index generated: $INDEX_FILE"
|
||||
}
|
||||
|
||||
main() {
|
||||
log_step "Generating documentation index..."
|
||||
generate_index
|
||||
log_info "Done!"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
57
scripts/docs/update-diagrams.sh
Executable file
57
scripts/docs/update-diagrams.sh
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
source ~/.bashrc
|
||||
# Update Diagrams
|
||||
# Regenerates diagrams from source files (if using Mermaid or similar)
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
DIAGRAMS_DIR="$PROJECT_ROOT/diagrams"
|
||||
DOCS_DIR="$PROJECT_ROOT/docs"
|
||||
|
||||
# Colors
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
log_info() {
|
||||
echo -e "${GREEN}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
log_warn() {
|
||||
echo -e "${YELLOW}[WARN]${NC} $1"
|
||||
}
|
||||
|
||||
check_diagrams() {
|
||||
log_info "Checking for diagram source files..."
|
||||
|
||||
if [ ! -d "$DIAGRAMS_DIR" ]; then
|
||||
log_warn "Diagrams directory not found: $DIAGRAMS_DIR"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local diagram_count=0
|
||||
while IFS= read -r -d '' file; do
|
||||
diagram_count=$((diagram_count + 1))
|
||||
log_info "Found diagram: $(basename "$file")"
|
||||
done < <(find "$DIAGRAMS_DIR" -name "*.mmd" -o -name "*.mermaid" -type f -print0 2>/dev/null)
|
||||
|
||||
if [ $diagram_count -eq 0 ]; then
|
||||
log_warn "No diagram source files found"
|
||||
else
|
||||
log_info "Found $diagram_count diagram source file(s)"
|
||||
log_info "To render diagrams, use Mermaid CLI or online editor"
|
||||
log_info "Mermaid CLI: npm install -g @mermaid-js/mermaid-cli"
|
||||
log_info "Then run: mmdc -i diagram.mmd -o diagram.png"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
log_info "Updating diagrams..."
|
||||
check_diagrams
|
||||
log_info "Done!"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
111
scripts/docs/validate-docs.sh
Executable file
111
scripts/docs/validate-docs.sh
Executable file
@@ -0,0 +1,111 @@
|
||||
#!/bin/bash
|
||||
source ~/.bashrc
|
||||
# Validate Documentation
|
||||
# Checks for broken links, outdated content, and documentation issues
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
DOCS_DIR="$PROJECT_ROOT/docs"
|
||||
|
||||
# Colors
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
log_info() {
|
||||
echo -e "${GREEN}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
log_warn() {
|
||||
echo -e "${YELLOW}[WARN]${NC} $1"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
echo -e "${RED}[ERROR]${NC} $1"
|
||||
}
|
||||
|
||||
check_markdown_links() {
|
||||
log_info "Checking markdown links..."
|
||||
local errors=0
|
||||
|
||||
while IFS= read -r -d '' file; do
|
||||
# Extract links from markdown files
|
||||
while IFS= read -r line; do
|
||||
if [[ $line =~ \[([^\]]+)\]\(([^)]+)\) ]]; then
|
||||
link="${BASH_REMATCH[2]}"
|
||||
# Skip external links
|
||||
if [[ ! $link =~ ^https?:// ]]; then
|
||||
# Remove anchor
|
||||
link_file="${link%%#*}"
|
||||
if [ -n "$link_file" ] && [ ! -f "$DOCS_DIR/$link_file" ] && [ ! -f "$(dirname "$file")/$link_file" ]; then
|
||||
log_error "Broken link in $(basename "$file"): $link"
|
||||
errors=$((errors + 1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done < "$file"
|
||||
done < <(find "$DOCS_DIR" -name "*.md" -type f -print0)
|
||||
|
||||
if [ $errors -eq 0 ]; then
|
||||
log_info "All markdown links are valid"
|
||||
else
|
||||
log_error "Found $errors broken link(s)"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_missing_files() {
|
||||
log_info "Checking for missing documentation files..."
|
||||
local missing=0
|
||||
|
||||
# Check for expected files
|
||||
expected_files=(
|
||||
"getting-started/quick-start.md"
|
||||
"getting-started/prerequisites.md"
|
||||
"getting-started/installation.md"
|
||||
"architecture/overview.md"
|
||||
"deployment/deployment-guide.md"
|
||||
)
|
||||
|
||||
for file in "${expected_files[@]}"; do
|
||||
if [ ! -f "$DOCS_DIR/$file" ]; then
|
||||
log_warn "Missing expected file: $file"
|
||||
missing=$((missing + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $missing -eq 0 ]; then
|
||||
log_info "All expected documentation files exist"
|
||||
else
|
||||
log_warn "Found $missing missing file(s)"
|
||||
fi
|
||||
}
|
||||
|
||||
check_index() {
|
||||
log_info "Checking documentation index..."
|
||||
if [ ! -f "$DOCS_DIR/INDEX.md" ]; then
|
||||
log_error "Documentation index (INDEX.md) not found"
|
||||
log_info "Run ./scripts/docs/generate-docs-index.sh to generate it"
|
||||
return 1
|
||||
else
|
||||
log_info "Documentation index exists"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
log_info "Validating documentation..."
|
||||
echo ""
|
||||
|
||||
check_index
|
||||
check_missing_files
|
||||
check_markdown_links
|
||||
|
||||
echo ""
|
||||
log_info "Documentation validation complete"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Reference in New Issue
Block a user