#!/bin/bash

# Wasot Auto-ID Generation Demonstration
# This script shows how the Wasot parser automatically assigns IDs to blocks

set -e

echo "🎯 Wasot Auto-ID Generation Demo"
echo "================================"
echo

# Colors for output
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

echo -e "${BLUE}📄 Original Wasot file (examples/auto_id_demo.wasot):${NC}"
echo "----------------------------------------------------"
cat examples/auto_id_demo.wasot
echo

echo -e "${YELLOW}🔄 After parsing with auto-generated IDs:${NC}"
echo "---------------------------------------------"
cargo run --quiet --bin wasot -- pretty examples/auto_id_demo.wasot

echo
echo -e "${GREEN}✅ Key observations:${NC}"
echo "• Each block now has an ID (e.g., '.section :1', '.paragraph :2')"
echo "• IDs start from '1' and increment in base36 (1, 2, 3, ..., a, b, c, ...)"
echo "• Manual IDs like ':manual-id' and ':footer-2023' are preserved"
echo "• Auto-generated IDs fill in the gaps and continue the sequence"
echo "• Plain text remains unchanged (no IDs needed)"