2026-05-06 10:23:00 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
OUTPUT_DIR="$REPO_ROOT/slides"
|
|
|
|
|
mkdir -p "$OUTPUT_DIR"
|
|
|
|
|
|
|
|
|
|
# Find all markdown files with marp: true frontmatter
|
|
|
|
|
SLIDES=()
|
|
|
|
|
while IFS= read -r f; do
|
|
|
|
|
SLIDES+=("$f")
|
|
|
|
|
done < <(grep -rl "^marp: true" "$REPO_ROOT/docs" --include="*.md" 2>/dev/null || true)
|
|
|
|
|
|
|
|
|
|
if [ ${#SLIDES[@]} -eq 0 ]; then
|
|
|
|
|
echo "No marp presentations found in docs/."
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "Found ${#SLIDES[@]} presentation(s):"
|
|
|
|
|
printf ' %s\n' "${SLIDES[@]}"
|
|
|
|
|
|
2026-05-10 12:21:09 +02:00
|
|
|
if command -v marp &>/dev/null; then
|
2026-05-06 10:23:00 +02:00
|
|
|
marp --html --output "$OUTPUT_DIR/" "${SLIDES[@]}"
|
|
|
|
|
else
|
|
|
|
|
echo "marp not found locally — using Docker (marpteam/marp-cli)..."
|
|
|
|
|
REL_SLIDES=()
|
|
|
|
|
for f in "${SLIDES[@]}"; do
|
|
|
|
|
REL_SLIDES+=("${f#"$REPO_ROOT"/}")
|
|
|
|
|
done
|
|
|
|
|
docker run --rm \
|
|
|
|
|
-v "$REPO_ROOT":/home/marp/app:ro \
|
|
|
|
|
-v "$OUTPUT_DIR":/home/marp/output \
|
|
|
|
|
marpteam/marp-cli --html --output /home/marp/output "${REL_SLIDES[@]}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "Done — slides in $OUTPUT_DIR/"
|