#!/usr/bin/env bash # Build a printable QR sticker sheet from gen-kit-codes.sh output. Each sticker # shows the kit id, a QR of the claim URL, and the 6-digit code — scanning it # opens /workshop?kit=..&code=.. with both pre-filled. QRs are baked in as inline # SVG, so the output HTML is fully self-contained (no fonts/scripts/network). # # ./gen-qr-sheet.sh [kit-codes.csv] [out.html] # # Requires qrencode at build time (brew install qrencode). Open the HTML and # print it (A4, ~9 stickers/page); the dashed borders are cut lines. set -euo pipefail CSV="${1:-kit-codes/kit-codes.csv}" OUT="${2:-kit-codes/qr-sheet.html}" command -v qrencode >/dev/null || { echo "need qrencode — brew install qrencode" >&2; exit 1; } [ -r "$CSV" ] || { echo "no CSV at $CSV (run gen-kit-codes.sh first)" >&2; exit 1; } esc() { sed -e 's/&/\&/g; s//\>/g'; } { cat <<'HEAD' APESS 2026 — kit claim stickers

APESS 2026 · Uno Q kit claim stickers

One sticker per kit. Scan the QR (or open the code manually) to claim your board to your team.

Tip: print at 100% scale. The dashed borders are cut lines.

HEAD n=0 while IFS=',' read -r kit code url || [ -n "$kit" ]; do kit="$(printf '%s' "$kit" | tr -d ' \r')" code="$(printf '%s' "$code" | tr -d ' \r')" url="$(printf '%s' "$url" | tr -d ' \r')" [ -z "$kit" ] && continue [ "$kit" = "kit" ] && continue case "$kit" in \#*) continue ;; esac svg="$(qrencode -t SVG -m 1 -s 4 -o - "$url" | sed -n '/\n' printf '
%s
\n' "$(printf '%s' "$kit" | esc)" printf '
%s
\n' "$svg" printf '
%sclaim code
\n' "$(printf '%s' "$code" | esc)" printf '
apess.redclaw.dev · claim to your team
\n' printf '
\n' n=$((n + 1)) done < "$CSV" printf '\n' } > "$OUT" echo "wrote $n sticker(s) to $OUT — open it and print (A4, 100% scale)" >&2