Seven hand-authored SVG diagrams (context, runtime, memory, safety chain, stack, contracts, evaluation) rendered via headless Chrome; generator and render script included for regeneration and the Chinese edition. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bg6jx9vHNHzB91qyV64GQ7
17 lines
653 B
Bash
Executable File
17 lines
653 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Regenerates docs/external/img/*.png from gen.mjs (hand-authored SVG) using headless Chrome.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
CHROME="${CHROME:-/Applications/Google Chrome.app/Contents/MacOS/Google Chrome}"
|
|
tmp=$(mktemp -d)
|
|
node gen.mjs "$tmp" >/dev/null
|
|
for f in "$tmp"/*.html; do
|
|
n=$(basename "${f%.html}")
|
|
dims=$(grep -o 'width="[0-9]*" height="[0-9]*" font' "$f" | head -1 | grep -o '[0-9]*' | tr '\n' ' ')
|
|
set -- $dims
|
|
"$CHROME" --headless=new --disable-gpu --hide-scrollbars --force-device-scale-factor=2 \
|
|
--window-size="$1,$2" --screenshot="../img/$n.png" "$f" >/dev/null 2>&1
|
|
done
|
|
rm -rf "$tmp"
|
|
ls ../img
|