DECK Frontend v4.3 - Portable with trivial extraction

- Simplified header (removed tag examples that interfered with extraction)
- Added extract.sh script for 3-file separation
- Structure: <style>, <body>, <script> cleanly separable
- Run: ./extract.sh deck.html → styles.css, app.js, index.html

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
ARCHITECT
2026-01-16 18:37:31 +00:00
parent 9b244138b5
commit 0bd1d6fbff
2 changed files with 57 additions and 30 deletions

52
deck-frontend/extract.sh Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/bash
# DECK Extract - Separates monolithic HTML into 3 files
# Usage: ./extract.sh deck.html [output_dir]
set -e
INPUT="${1:-deck.html}"
OUTDIR="${2:-.}"
if [ ! -f "$INPUT" ]; then
echo "Error: $INPUT not found"
exit 1
fi
mkdir -p "$OUTDIR"
# Extract CSS (between <style> and </style>, excluding the tags themselves)
awk '/<style>/,/<\/style>/' "$INPUT" | tail -n +2 | head -n -1 > "$OUTDIR/styles.css"
# Extract JS (between <script> and </script>, excluding the tags themselves)
awk '/<script>/,/<\/script>/' "$INPUT" | tail -n +2 | head -n -1 > "$OUTDIR/app.js"
# Create index.html with external references
cat > "$OUTDIR/index.html" << 'HTMLEOF'
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DECK - TZZR</title>
<meta name="description" content="DECK Tag Management System">
<link rel="stylesheet" href="styles.css">
</head>
HTMLEOF
# Extract body content (excluding </body> and inline script)
awk '/<body>/,/<\/body>/' "$INPUT" | head -n -1 | awk '/<script>/,/<\/script>/{next}1' >> "$OUTDIR/index.html"
# Close with script reference
cat >> "$OUTDIR/index.html" << 'HTMLEOF'
<script src="app.js"></script>
</body>
</html>
HTMLEOF
CSS_LINES=$(wc -l < "$OUTDIR/styles.css")
JS_LINES=$(wc -l < "$OUTDIR/app.js")
echo "Extracted to $OUTDIR/"
echo " - styles.css ($CSS_LINES lines)"
echo " - app.js ($JS_LINES lines)"
echo " - index.html"