MakerFLOSS/build-slides.sh
sjat 141511322f Add marp slide infra and messaging alternatives presentation
- build-slides.sh: local build script (uses marp CLI or Docker fallback)
- slides/.gitkeep: output directory tracked, generated HTML gitignored
- docs/møder/2026-05-xx-messaging-presentation.md: first presentation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 10:23:00 +02:00

36 lines
994 B
Bash
Executable file

#!/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[@]}"
if command -v marp &>/dev/null; then
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/"