Exercise baseline

This commit is contained in:
2026-09-17 20:42:49 +01:00
commit 863c7a6349
36 changed files with 3898 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Render a mermaid diagram to SVG using mmdc with sandbox/GPU workarounds
# for Ubuntu 24.04+ (AppArmor restrictions).
#
# Usage: scripts/mermaid.sh input.mmd [output.svg]
# scripts/mermaid.sh input.mmd - # output to stdout
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
CONFIG="$REPO_ROOT/puppeteer.config.json"
if [[ $# -lt 1 ]]; then
echo "Usage: $0 <input.mmd> [output.svg|-]" >&2
exit 1
fi
INPUT="$1"
shift
ARGS=("-i" "$INPUT" "-p" "$CONFIG")
if [[ $# -gt 0 ]]; then
OUTPUT="$1"
shift
ARGS+=("-o" "$OUTPUT")
fi
ARGS+=("$@")
exec mmdc "${ARGS[@]}"