jekyll-theme-zer0 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +74 -0
- data/README.md +1 -1
- data/_includes/components/cookie-consent.html +81 -9
- data/_includes/components/js-cdn.html +4 -1
- data/_includes/components/mermaid.html +260 -14
- data/_includes/components/search-modal.html +56 -0
- data/_includes/core/branding.html +12 -13
- data/_includes/core/head.html +1 -0
- data/_includes/core/header.html +38 -11
- data/_includes/navigation/navbar.html +31 -0
- data/_layouts/landing.html +21 -21
- data/_layouts/root.html +3 -0
- data/_sass/core/code-copy.scss +45 -6
- data/_sass/custom.scss +620 -1
- data/assets/js/code-copy.js +79 -13
- data/assets/js/modules/navigation/keyboard.js +9 -2
- data/assets/js/search-modal.js +239 -0
- data/assets/js/ui-enhancements.js +164 -0
- data/scripts/init_setup.sh +544 -0
- data/scripts/test-notebook-conversion.sh +105 -0
- metadata +11 -6
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# AI-Powered Self-Healing Jekyll Theme Setup Script
|
|
4
|
+
# Part of the IT-Journey AI Evolution Engine Seed
|
|
5
|
+
# Designed for Docker-first development with intelligent error recovery
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
# Configuration
|
|
10
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
|
+
PROJECT_NAME="$(basename "$SCRIPT_DIR")"
|
|
12
|
+
LOG_FILE="${SCRIPT_DIR}/setup.log"
|
|
13
|
+
CONFIG_DEV_FILE="${SCRIPT_DIR}/_config_dev.yml"
|
|
14
|
+
DOCKER_COMPOSE_FILE="${SCRIPT_DIR}/docker-compose.yml"
|
|
15
|
+
INSTALL_SCRIPT="${SCRIPT_DIR}/install.sh"
|
|
16
|
+
|
|
17
|
+
# Colors for output
|
|
18
|
+
RED='\033[0;31m'
|
|
19
|
+
GREEN='\033[0;32m'
|
|
20
|
+
YELLOW='\033[1;33m'
|
|
21
|
+
BLUE='\033[0;34m'
|
|
22
|
+
CYAN='\033[0;36m'
|
|
23
|
+
PURPLE='\033[0;35m'
|
|
24
|
+
NC='\033[0m' # No Color
|
|
25
|
+
|
|
26
|
+
# Enhanced logging functions
|
|
27
|
+
log() {
|
|
28
|
+
echo -e "${BLUE}[$(date +'%Y-%m-%d %H:%M:%S')]${NC} $1" | tee -a "$LOG_FILE"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
error() {
|
|
32
|
+
echo -e "${RED}[ERROR]${NC} $1" | tee -a "$LOG_FILE"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
success() {
|
|
36
|
+
echo -e "${GREEN}[SUCCESS]${NC} $1" | tee -a "$LOG_FILE"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
warning() {
|
|
40
|
+
echo -e "${YELLOW}[WARNING]${NC} $1" | tee -a "$LOG_FILE"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
info() {
|
|
44
|
+
echo -e "${CYAN}[INFO]${NC} $1" | tee -a "$LOG_FILE"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
evolution() {
|
|
48
|
+
echo -e "${PURPLE}[EVOLUTION]${NC} $1" | tee -a "$LOG_FILE"
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
# Display evolution banner
|
|
52
|
+
show_evolution_banner() {
|
|
53
|
+
echo -e "${CYAN}"
|
|
54
|
+
cat << 'EOF'
|
|
55
|
+
╭─────────────────────────────────────────────╮
|
|
56
|
+
│ 🌱 AI-POWERED JEKYLL EVOLUTION SEED 🌱 │
|
|
57
|
+
│ │
|
|
58
|
+
│ Design for Failure (DFF) ✅ │
|
|
59
|
+
│ Don't Repeat Yourself (DRY) ✅ │
|
|
60
|
+
│ Keep It Simple (KIS) ✅ │
|
|
61
|
+
│ AI-Powered Development (AIPD) ✅ │
|
|
62
|
+
│ │
|
|
63
|
+
│ 🐳 Docker-First • 🔧 Self-Healing │
|
|
64
|
+
│ 🤖 AI-Enhanced • ⚡ Cross-Platform │
|
|
65
|
+
╰─────────────────────────────────────────────╯
|
|
66
|
+
EOF
|
|
67
|
+
echo -e "${NC}"
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
# AI-powered environment detection and optimization
|
|
71
|
+
detect_environment() {
|
|
72
|
+
evolution "🔍 Running AI-powered environment detection..."
|
|
73
|
+
|
|
74
|
+
# Platform detection
|
|
75
|
+
PLATFORM=$(uname -s)
|
|
76
|
+
ARCH=$(uname -m)
|
|
77
|
+
info "🖥️ Platform: $PLATFORM ($ARCH)"
|
|
78
|
+
|
|
79
|
+
# Docker availability check
|
|
80
|
+
if ! command -v docker &> /dev/null; then
|
|
81
|
+
error "Docker is not installed. Please install Docker Desktop."
|
|
82
|
+
info "📖 Visit: https://docs.docker.com/get-docker/"
|
|
83
|
+
return 1
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
# Docker Compose availability
|
|
87
|
+
if command -v docker-compose &> /dev/null; then
|
|
88
|
+
COMPOSE_CMD="docker-compose"
|
|
89
|
+
info "🐳 Docker Compose (standalone) detected"
|
|
90
|
+
elif docker compose version &> /dev/null 2>&1; then
|
|
91
|
+
COMPOSE_CMD="docker compose"
|
|
92
|
+
info "🐳 Docker Compose (plugin) detected"
|
|
93
|
+
else
|
|
94
|
+
error "Docker Compose is not available"
|
|
95
|
+
return 1
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
# Docker daemon check
|
|
99
|
+
if ! docker info &> /dev/null; then
|
|
100
|
+
error "Docker daemon is not running. Please start Docker Desktop."
|
|
101
|
+
return 1
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
success "✅ Docker environment validated"
|
|
105
|
+
return 0
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
# Apple Silicon specific optimizations
|
|
109
|
+
optimize_for_apple_silicon() {
|
|
110
|
+
if [[ "$(uname -s)" == "Darwin" && "$(uname -m)" == "arm64" ]]; then
|
|
111
|
+
evolution "🍎 Applying Apple Silicon optimizations..."
|
|
112
|
+
|
|
113
|
+
# Ensure platform specification in docker-compose
|
|
114
|
+
if [[ -f "$DOCKER_COMPOSE_FILE" ]] && ! grep -q "platform: linux/amd64" "$DOCKER_COMPOSE_FILE"; then
|
|
115
|
+
warning "Adding platform specification for Apple Silicon compatibility"
|
|
116
|
+
# This will be handled by the install script
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
# Check for Rosetta 2
|
|
120
|
+
if ! arch -x86_64 uname -m &> /dev/null; then
|
|
121
|
+
warning "Rosetta 2 not detected. Some Docker images may require it."
|
|
122
|
+
info "Install with: softwareupdate --install-rosetta"
|
|
123
|
+
fi
|
|
124
|
+
|
|
125
|
+
success "✅ Apple Silicon optimizations applied"
|
|
126
|
+
fi
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
# Intelligent issue detection and auto-healing
|
|
130
|
+
detect_and_heal_issues() {
|
|
131
|
+
evolution "🧠 Running intelligent issue detection..."
|
|
132
|
+
|
|
133
|
+
local issues_found=0
|
|
134
|
+
|
|
135
|
+
# Check for Jekyll theme issues
|
|
136
|
+
if [[ -f "Gemfile" ]] && grep -q "jekyll-theme-zer0" Gemfile && [[ ! -f "jekyll-theme-zer0.gemspec" ]]; then
|
|
137
|
+
warning "Jekyll theme gemspec missing - enabling Docker-first mode"
|
|
138
|
+
issues_found=$((issues_found + 1))
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
# Check for problematic includes in README
|
|
142
|
+
if [[ -f "README.md" ]] && grep -q "{% include" README.md; then
|
|
143
|
+
warning "Jekyll includes detected in README.md - may cause Docker build issues"
|
|
144
|
+
issues_found=$((issues_found + 1))
|
|
145
|
+
fi
|
|
146
|
+
|
|
147
|
+
# Check for missing development config
|
|
148
|
+
if [[ ! -f "$CONFIG_DEV_FILE" ]]; then
|
|
149
|
+
warning "Development configuration missing - will auto-generate"
|
|
150
|
+
issues_found=$((issues_found + 1))
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
# Check for missing Docker configuration
|
|
154
|
+
if [[ ! -f "$DOCKER_COMPOSE_FILE" ]]; then
|
|
155
|
+
warning "Docker Compose configuration missing - will auto-generate"
|
|
156
|
+
issues_found=$((issues_found + 1))
|
|
157
|
+
fi
|
|
158
|
+
|
|
159
|
+
if [[ $issues_found -eq 0 ]]; then
|
|
160
|
+
success "✅ No issues detected - environment is healthy"
|
|
161
|
+
else
|
|
162
|
+
info "🔧 Found $issues_found issues - initiating auto-healing"
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
return 0
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
# Execute enhanced installation process
|
|
169
|
+
run_enhanced_installation() {
|
|
170
|
+
evolution "🚀 Executing enhanced installation process..."
|
|
171
|
+
|
|
172
|
+
if [[ -f "$INSTALL_SCRIPT" ]]; then
|
|
173
|
+
info "🔧 Running enhanced install.sh script..."
|
|
174
|
+
chmod +x "$INSTALL_SCRIPT"
|
|
175
|
+
|
|
176
|
+
if bash "$INSTALL_SCRIPT"; then
|
|
177
|
+
success "✅ Enhanced installation completed successfully"
|
|
178
|
+
return 0
|
|
179
|
+
else
|
|
180
|
+
error "Enhanced installation failed - falling back to basic setup"
|
|
181
|
+
return 1
|
|
182
|
+
fi
|
|
183
|
+
else
|
|
184
|
+
warning "install.sh not found - creating basic setup"
|
|
185
|
+
return 1
|
|
186
|
+
fi
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
# Basic setup fallback with intelligent defaults
|
|
190
|
+
create_basic_setup() {
|
|
191
|
+
evolution "📦 Creating intelligent basic setup..."
|
|
192
|
+
|
|
193
|
+
# Create Docker Compose with platform detection
|
|
194
|
+
if [[ ! -f "$DOCKER_COMPOSE_FILE" ]]; then
|
|
195
|
+
info "🐳 Generating Docker Compose configuration..."
|
|
196
|
+
|
|
197
|
+
local platform_spec=""
|
|
198
|
+
if [[ "$(uname -s)" == "Darwin" && "$(uname -m)" == "arm64" ]]; then
|
|
199
|
+
platform_spec=" platform: linux/amd64"
|
|
200
|
+
fi
|
|
201
|
+
|
|
202
|
+
cat > "$DOCKER_COMPOSE_FILE" << EOF
|
|
203
|
+
version: '3.8'
|
|
204
|
+
|
|
205
|
+
services:
|
|
206
|
+
jekyll:
|
|
207
|
+
image: jekyll/jekyll:4.2.0
|
|
208
|
+
${platform_spec}
|
|
209
|
+
command: jekyll serve --config _config_dev.yml --host 0.0.0.0 --livereload --force_polling --trace
|
|
210
|
+
ports:
|
|
211
|
+
- "4000:4000"
|
|
212
|
+
- "35729:35729"
|
|
213
|
+
volumes:
|
|
214
|
+
- .:/srv/jekyll:Z
|
|
215
|
+
- bundle_cache:/usr/local/bundle
|
|
216
|
+
environment:
|
|
217
|
+
- JEKYLL_ENV=development
|
|
218
|
+
- BUNDLE_PATH=/usr/local/bundle
|
|
219
|
+
|
|
220
|
+
volumes:
|
|
221
|
+
bundle_cache:
|
|
222
|
+
EOF
|
|
223
|
+
success "✅ Docker Compose configuration created"
|
|
224
|
+
fi
|
|
225
|
+
|
|
226
|
+
# Create development configuration
|
|
227
|
+
if [[ ! -f "$CONFIG_DEV_FILE" ]]; then
|
|
228
|
+
info "⚙️ Generating development configuration..."
|
|
229
|
+
|
|
230
|
+
cat > "$CONFIG_DEV_FILE" << 'EOF'
|
|
231
|
+
# AI-Generated Development Configuration
|
|
232
|
+
# Optimized for Docker-first development
|
|
233
|
+
|
|
234
|
+
# Essential plugins for Jekyll
|
|
235
|
+
plugins:
|
|
236
|
+
- jekyll-feed
|
|
237
|
+
- jekyll-sitemap
|
|
238
|
+
- jekyll-seo-tag
|
|
239
|
+
- jekyll-paginate
|
|
240
|
+
- jekyll-include-cache
|
|
241
|
+
|
|
242
|
+
# Docker-optimized settings
|
|
243
|
+
url: ""
|
|
244
|
+
baseurl: ""
|
|
245
|
+
|
|
246
|
+
# Disable remote theme for Docker compatibility
|
|
247
|
+
remote_theme: false
|
|
248
|
+
|
|
249
|
+
# Development optimizations
|
|
250
|
+
incremental: true
|
|
251
|
+
livereload: true
|
|
252
|
+
open_browser: false
|
|
253
|
+
show_drafts: true
|
|
254
|
+
future: true
|
|
255
|
+
unpublished: true
|
|
256
|
+
|
|
257
|
+
# Performance settings
|
|
258
|
+
safe: false
|
|
259
|
+
profile: true
|
|
260
|
+
|
|
261
|
+
# Markdown configuration
|
|
262
|
+
markdown: kramdown
|
|
263
|
+
highlighter: rouge
|
|
264
|
+
|
|
265
|
+
kramdown:
|
|
266
|
+
input: GFM
|
|
267
|
+
hard_wrap: false
|
|
268
|
+
syntax_highlighter: rouge
|
|
269
|
+
EOF
|
|
270
|
+
success "✅ Development configuration created"
|
|
271
|
+
fi
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
# Test Docker setup functionality
|
|
275
|
+
test_docker_functionality() {
|
|
276
|
+
evolution "🧪 Testing Docker functionality..."
|
|
277
|
+
|
|
278
|
+
info "🔍 Validating Docker Compose syntax..."
|
|
279
|
+
if ! $COMPOSE_CMD config &> /dev/null; then
|
|
280
|
+
error "Docker Compose configuration is invalid"
|
|
281
|
+
return 1
|
|
282
|
+
fi
|
|
283
|
+
|
|
284
|
+
info "🔍 Testing container build process..."
|
|
285
|
+
if ! $COMPOSE_CMD build --quiet &> /dev/null; then
|
|
286
|
+
warning "Container build test failed - may need manual intervention"
|
|
287
|
+
return 1
|
|
288
|
+
fi
|
|
289
|
+
|
|
290
|
+
success "✅ Docker functionality test passed"
|
|
291
|
+
return 0
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
# Start development environment
|
|
295
|
+
start_development_environment() {
|
|
296
|
+
evolution "🌐 Starting AI-optimized development environment..."
|
|
297
|
+
|
|
298
|
+
info "🚢 Building and starting Jekyll container..."
|
|
299
|
+
info "📍 Site will be available at: http://localhost:4000"
|
|
300
|
+
info "🔄 LiveReload available at: http://localhost:35729"
|
|
301
|
+
info "🛑 Press Ctrl+C to stop the server"
|
|
302
|
+
info ""
|
|
303
|
+
|
|
304
|
+
$COMPOSE_CMD up --build
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
# Generate comprehensive documentation
|
|
308
|
+
generate_documentation() {
|
|
309
|
+
evolution "📚 Generating AI-enhanced documentation..."
|
|
310
|
+
|
|
311
|
+
if [[ ! -f "README.md" ]] || [[ $(wc -l < README.md) -lt 10 ]]; then
|
|
312
|
+
info "📝 Creating comprehensive README.md..."
|
|
313
|
+
|
|
314
|
+
cat > "README.md" << 'EOF'
|
|
315
|
+
# AI-Powered Jekyll Theme
|
|
316
|
+
|
|
317
|
+
A modern, Docker-first Jekyll theme with intelligent automation and self-healing capabilities.
|
|
318
|
+
|
|
319
|
+
## 🚀 Quick Start
|
|
320
|
+
|
|
321
|
+
### Docker Development (Recommended)
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
# Initialize and start development environment
|
|
325
|
+
./scripts/init_setup.sh init
|
|
326
|
+
./scripts/init_setup.sh start
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Manual Setup
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
# Install dependencies
|
|
333
|
+
bundle install
|
|
334
|
+
|
|
335
|
+
# Start development server
|
|
336
|
+
bundle exec jekyll serve --config _config_dev.yml
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## 🐳 Docker-First Development
|
|
340
|
+
|
|
341
|
+
This theme is optimized for Docker-first development with:
|
|
342
|
+
|
|
343
|
+
- ✅ Cross-platform compatibility (Intel/Apple Silicon)
|
|
344
|
+
- ✅ Automatic platform detection and optimization
|
|
345
|
+
- ✅ Self-healing configuration management
|
|
346
|
+
- ✅ AI-powered error detection and recovery
|
|
347
|
+
|
|
348
|
+
## 🧠 AI-Powered Features
|
|
349
|
+
|
|
350
|
+
### Intelligent Setup
|
|
351
|
+
- Automatic environment detection
|
|
352
|
+
- Platform-specific optimizations
|
|
353
|
+
- Issue detection and auto-healing
|
|
354
|
+
- Docker compatibility validation
|
|
355
|
+
|
|
356
|
+
### Self-Healing Configuration
|
|
357
|
+
- Auto-generated development configs
|
|
358
|
+
- Theme compatibility management
|
|
359
|
+
- Cross-platform Docker settings
|
|
360
|
+
- Intelligent error recovery
|
|
361
|
+
|
|
362
|
+
## 📁 Project Structure
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
├── _config.yml # Production configuration
|
|
366
|
+
├── _config_dev.yml # Development configuration (auto-generated)
|
|
367
|
+
├── docker-compose.yml # Docker development environment
|
|
368
|
+
├── scripts/init_setup.sh # AI-powered setup script
|
|
369
|
+
├── install.sh # Enhanced installation script
|
|
370
|
+
└── pages/ # Content pages
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## 🔧 Available Commands
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
./scripts/init_setup.sh init # Initialize development environment
|
|
377
|
+
./scripts/init_setup.sh start # Start development server
|
|
378
|
+
./scripts/init_setup.sh test # Test Docker setup
|
|
379
|
+
./scripts/init_setup.sh help # Show usage information
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
## 🐛 Troubleshooting
|
|
383
|
+
|
|
384
|
+
### Common Issues
|
|
385
|
+
|
|
386
|
+
**Theme not found errors:**
|
|
387
|
+
- The setup automatically disables local theme dependencies for Docker compatibility
|
|
388
|
+
- Development configuration is optimized for container environments
|
|
389
|
+
|
|
390
|
+
**Docker build failures:**
|
|
391
|
+
- Ensure Docker Desktop is running
|
|
392
|
+
- On Apple Silicon: platform compatibility is auto-configured
|
|
393
|
+
- Check `setup.log` for detailed error information
|
|
394
|
+
|
|
395
|
+
**Port conflicts:**
|
|
396
|
+
- Default ports: 4000 (Jekyll), 35729 (LiveReload)
|
|
397
|
+
- Modify `docker-compose.yml` to use different ports if needed
|
|
398
|
+
|
|
399
|
+
### Getting Help
|
|
400
|
+
|
|
401
|
+
1. Check `setup.log` for detailed logs
|
|
402
|
+
2. Ensure all prerequisites are installed
|
|
403
|
+
3. Verify Docker Desktop is running
|
|
404
|
+
4. Try running `./scripts/init_setup.sh test` to diagnose issues
|
|
405
|
+
|
|
406
|
+
## 🤝 Contributing
|
|
407
|
+
|
|
408
|
+
This project follows AI-powered development principles:
|
|
409
|
+
|
|
410
|
+
- **Design for Failure (DFF)**: Comprehensive error handling
|
|
411
|
+
- **Keep It Simple (KIS)**: Clear, maintainable code
|
|
412
|
+
- **Don't Repeat Yourself (DRY)**: Reusable components
|
|
413
|
+
- **AI-Powered Development (AIPD)**: Intelligent automation
|
|
414
|
+
|
|
415
|
+
## 📄 License
|
|
416
|
+
|
|
417
|
+
[Add your license information here]
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
*Generated by AI-Powered Jekyll Evolution Engine*
|
|
422
|
+
EOF
|
|
423
|
+
success "✅ Comprehensive README.md created"
|
|
424
|
+
fi
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
# Display usage information
|
|
428
|
+
show_usage() {
|
|
429
|
+
cat << EOF
|
|
430
|
+
|
|
431
|
+
🚀 AI-Powered Jekyll Theme Setup
|
|
432
|
+
|
|
433
|
+
Usage: $0 [command]
|
|
434
|
+
|
|
435
|
+
Commands:
|
|
436
|
+
init Initialize development environment (default)
|
|
437
|
+
start Start development server
|
|
438
|
+
test Test Docker setup and functionality
|
|
439
|
+
docs Generate comprehensive documentation
|
|
440
|
+
help Show this help message
|
|
441
|
+
|
|
442
|
+
Examples:
|
|
443
|
+
$0 init # Set up everything for development
|
|
444
|
+
$0 start # Start the development server
|
|
445
|
+
$0 test # Validate Docker configuration
|
|
446
|
+
$0 docs # Generate project documentation
|
|
447
|
+
|
|
448
|
+
🐳 Docker-First Development:
|
|
449
|
+
This script prioritizes Docker for a consistent, cross-platform development experience.
|
|
450
|
+
|
|
451
|
+
🧠 AI-Powered Features:
|
|
452
|
+
✅ Automatic platform detection and optimization
|
|
453
|
+
✅ Intelligent error detection and auto-healing
|
|
454
|
+
✅ Self-healing configuration management
|
|
455
|
+
✅ Cross-platform compatibility (Intel/Apple Silicon)
|
|
456
|
+
|
|
457
|
+
🔧 Troubleshooting:
|
|
458
|
+
- Check setup.log for detailed logs
|
|
459
|
+
- Ensure Docker Desktop is running
|
|
460
|
+
- Run '$0 test' to diagnose Docker issues
|
|
461
|
+
|
|
462
|
+
For more information, see README.md or generated documentation.
|
|
463
|
+
|
|
464
|
+
EOF
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
# Main execution logic
|
|
468
|
+
main() {
|
|
469
|
+
# Initialize logging
|
|
470
|
+
touch "$LOG_FILE"
|
|
471
|
+
|
|
472
|
+
show_evolution_banner
|
|
473
|
+
evolution "🎯 Starting AI-Powered Jekyll Setup for $PROJECT_NAME"
|
|
474
|
+
|
|
475
|
+
case "${1:-init}" in
|
|
476
|
+
"init")
|
|
477
|
+
log "🔄 Initializing development environment..."
|
|
478
|
+
|
|
479
|
+
# Environment detection and optimization
|
|
480
|
+
if ! detect_environment; then
|
|
481
|
+
error "❌ Environment validation failed"
|
|
482
|
+
exit 1
|
|
483
|
+
fi
|
|
484
|
+
|
|
485
|
+
optimize_for_apple_silicon
|
|
486
|
+
detect_and_heal_issues
|
|
487
|
+
|
|
488
|
+
# Try enhanced installation first, fallback to basic
|
|
489
|
+
if ! run_enhanced_installation; then
|
|
490
|
+
warning "⚠️ Enhanced installation failed, creating basic setup..."
|
|
491
|
+
create_basic_setup
|
|
492
|
+
fi
|
|
493
|
+
|
|
494
|
+
# Test the setup
|
|
495
|
+
if test_docker_functionality; then
|
|
496
|
+
success "🎉 Development environment initialized successfully!"
|
|
497
|
+
info "💡 Run '$0 start' to begin development"
|
|
498
|
+
else
|
|
499
|
+
warning "⚠️ Setup completed with warnings - check setup.log"
|
|
500
|
+
fi
|
|
501
|
+
;;
|
|
502
|
+
|
|
503
|
+
"start")
|
|
504
|
+
log "🚀 Starting development environment..."
|
|
505
|
+
|
|
506
|
+
if ! detect_environment; then
|
|
507
|
+
error "❌ Environment not ready - run '$0 init' first"
|
|
508
|
+
exit 1
|
|
509
|
+
fi
|
|
510
|
+
|
|
511
|
+
start_development_environment
|
|
512
|
+
;;
|
|
513
|
+
|
|
514
|
+
"test")
|
|
515
|
+
log "🧪 Testing Docker setup..."
|
|
516
|
+
|
|
517
|
+
if detect_environment && test_docker_functionality; then
|
|
518
|
+
success "✅ All tests passed - Docker setup is working correctly"
|
|
519
|
+
else
|
|
520
|
+
error "❌ Tests failed - check setup.log for details"
|
|
521
|
+
exit 1
|
|
522
|
+
fi
|
|
523
|
+
;;
|
|
524
|
+
|
|
525
|
+
"docs")
|
|
526
|
+
log "📚 Generating documentation..."
|
|
527
|
+
generate_documentation
|
|
528
|
+
success "✅ Documentation generated successfully"
|
|
529
|
+
;;
|
|
530
|
+
|
|
531
|
+
"help"|"--help"|"-h")
|
|
532
|
+
show_usage
|
|
533
|
+
;;
|
|
534
|
+
|
|
535
|
+
*)
|
|
536
|
+
error "Unknown command: $1"
|
|
537
|
+
show_usage
|
|
538
|
+
exit 1
|
|
539
|
+
;;
|
|
540
|
+
esac
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
# Execute main function with all arguments
|
|
544
|
+
main "$@"
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Quick test script for Jupyter notebook conversion
|
|
4
|
+
# Run this after Docker build completes
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
echo "=========================================="
|
|
10
|
+
echo "Testing Jupyter Notebook Conversion"
|
|
11
|
+
echo "=========================================="
|
|
12
|
+
echo ""
|
|
13
|
+
|
|
14
|
+
# Test 1: Check if Docker container is running
|
|
15
|
+
echo "[TEST 1] Checking Docker container status..."
|
|
16
|
+
if docker-compose ps | grep -q "Up"; then
|
|
17
|
+
echo "✓ Docker container is running"
|
|
18
|
+
else
|
|
19
|
+
echo "⚠ Starting Docker container..."
|
|
20
|
+
docker-compose up -d
|
|
21
|
+
sleep 5
|
|
22
|
+
fi
|
|
23
|
+
echo ""
|
|
24
|
+
|
|
25
|
+
# Test 2: Verify Python and nbconvert are installed
|
|
26
|
+
echo "[TEST 2] Verifying Python and nbconvert in Docker..."
|
|
27
|
+
if docker-compose exec -T jekyll python3 -c "import nbconvert; print('nbconvert version:', nbconvert.__version__)" 2>/dev/null; then
|
|
28
|
+
echo "✓ Python and nbconvert are installed"
|
|
29
|
+
else
|
|
30
|
+
echo "✗ nbconvert is not installed in Docker"
|
|
31
|
+
echo " Run: docker-compose build to rebuild the container"
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
echo ""
|
|
35
|
+
|
|
36
|
+
# Test 3: List notebooks
|
|
37
|
+
echo "[TEST 3] Listing notebooks to convert..."
|
|
38
|
+
docker-compose exec -T jekyll ./scripts/convert-notebooks.sh --list
|
|
39
|
+
echo ""
|
|
40
|
+
|
|
41
|
+
# Test 4: Clean any existing converted files
|
|
42
|
+
echo "[TEST 4] Cleaning existing converted files..."
|
|
43
|
+
rm -f pages/_notebooks/*.md
|
|
44
|
+
rm -rf assets/images/notebooks/*
|
|
45
|
+
echo "✓ Cleaned"
|
|
46
|
+
echo ""
|
|
47
|
+
|
|
48
|
+
# Test 5: Convert notebooks
|
|
49
|
+
echo "[TEST 5] Converting notebooks..."
|
|
50
|
+
docker-compose exec -T jekyll ./scripts/convert-notebooks.sh --verbose
|
|
51
|
+
echo ""
|
|
52
|
+
|
|
53
|
+
# Test 6: Verify converted file exists
|
|
54
|
+
echo "[TEST 6] Verifying converted files..."
|
|
55
|
+
if [ -f "pages/_notebooks/test-notebook.md" ]; then
|
|
56
|
+
echo "✓ Converted file exists: pages/_notebooks/test-notebook.md"
|
|
57
|
+
echo ""
|
|
58
|
+
echo "Front matter preview:"
|
|
59
|
+
head -15 pages/_notebooks/test-notebook.md
|
|
60
|
+
echo ""
|
|
61
|
+
echo "File size: $(wc -l < pages/_notebooks/test-notebook.md) lines"
|
|
62
|
+
else
|
|
63
|
+
echo "✗ Converted file not found"
|
|
64
|
+
exit 1
|
|
65
|
+
fi
|
|
66
|
+
echo ""
|
|
67
|
+
|
|
68
|
+
# Test 7: Check for images
|
|
69
|
+
echo "[TEST 7] Checking for extracted images..."
|
|
70
|
+
if [ -d "assets/images/notebooks" ]; then
|
|
71
|
+
image_count=$(find assets/images/notebooks -type f 2>/dev/null | wc -l)
|
|
72
|
+
echo "✓ Found $image_count image file(s)"
|
|
73
|
+
else
|
|
74
|
+
echo "ℹ No images extracted (notebook may not have plots)"
|
|
75
|
+
fi
|
|
76
|
+
echo ""
|
|
77
|
+
|
|
78
|
+
# Test 8: Validate front matter
|
|
79
|
+
echo "[TEST 8] Validating front matter..."
|
|
80
|
+
if head -1 pages/_notebooks/test-notebook.md | grep -q "^---$"; then
|
|
81
|
+
echo "✓ Front matter starts correctly"
|
|
82
|
+
if sed -n '2,15p' pages/_notebooks/test-notebook.md | grep -q "^title:"; then
|
|
83
|
+
echo "✓ Title field present"
|
|
84
|
+
fi
|
|
85
|
+
if sed -n '2,15p' pages/_notebooks/test-notebook.md | grep -q "^layout: notebook"; then
|
|
86
|
+
echo "✓ Layout set to 'notebook'"
|
|
87
|
+
fi
|
|
88
|
+
else
|
|
89
|
+
echo "✗ Front matter malformed"
|
|
90
|
+
fi
|
|
91
|
+
echo ""
|
|
92
|
+
|
|
93
|
+
# Summary
|
|
94
|
+
echo "=========================================="
|
|
95
|
+
echo "Testing Complete!"
|
|
96
|
+
echo "=========================================="
|
|
97
|
+
echo ""
|
|
98
|
+
echo "Next steps:"
|
|
99
|
+
echo "1. Start Jekyll server: docker-compose up"
|
|
100
|
+
echo "2. Visit: http://localhost:4000/notebooks/test-notebook/"
|
|
101
|
+
echo "3. Check styling and layout"
|
|
102
|
+
echo ""
|
|
103
|
+
echo "To force reconvert:"
|
|
104
|
+
echo " docker-compose exec jekyll ./scripts/convert-notebooks.sh --force"
|
|
105
|
+
echo ""
|