vpp-ai-platform/docs/external/diagrams/render.sh
Thomas Bayes 19d24893c2
Some checks are pending
ci / typescript (push) Waiting to run
ci / python (push) Waiting to run
ci / evals (push) Blocked by required conditions
docs: add condensed external architecture brief with PNG diagrams
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
2026-09-02 12:55:53 -04:00

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