open-design/skills/html-ppt/scripts/new-deck.sh
marco 5dd70b5016
Some checks failed
ci / Validate workspace (push) Successful in 12m32s
landing-page-ci / Validate landing page (push) Successful in 9m41s
landing-page-deploy / Deploy landing page (push) Failing after 5m23s
github-metrics / Generate repository metrics SVG (push) Failing after 2m3s
refresh-contributors-wall / Refresh contributors wall cache bust (push) Failing after 11s
Initial import: open-design source for helix-mind.ai distribution
This repository contains the open-design daemon CLI source code, built
and packaged at https://helix-mind.ai/cli/open-design/latest.tgz for use
by the HelixMind /design slash command.

Licenses: Apache-2.0 (root) + MIT (skills/*)
2026-05-06 20:50:24 +02:00

47 lines
1.4 KiB
Bash

#!/usr/bin/env bash
# html-ppt :: new-deck.sh — scaffold a new deck from templates/deck.html
#
# Usage:
# new-deck.sh <name> [output-parent-dir]
#
# Creates <parent>/<name>/index.html with paths rewritten to point at the
# skill's shared assets/themes/animations. Defaults to ./examples/.
set -euo pipefail
NAME="${1:-}"
if [[ -z "$NAME" ]]; then
echo "usage: new-deck.sh <name> [parent-dir]" >&2
exit 1
fi
PARENT="${2:-examples}"
HERE="$(cd "$(dirname "$0")/.." && pwd)"
TEMPLATE="$HERE/templates/deck.html"
if [[ ! -f "$TEMPLATE" ]]; then
echo "error: template not found at $TEMPLATE" >&2
exit 1
fi
OUT_DIR="$HERE/$PARENT/$NAME"
if [[ -e "$OUT_DIR" ]]; then
echo "error: $OUT_DIR already exists" >&2
exit 1
fi
mkdir -p "$OUT_DIR"
# templates/deck.html references ../assets/...; for examples/<name>/index.html
# that same relative path (../../assets/...) needs one more ../.
sed 's|href="../assets/|href="../../assets/|g; s|src="../assets/|src="../../assets/|g; s|data-theme-base="../assets/|data-theme-base="../../assets/|g' \
"$TEMPLATE" > "$OUT_DIR/index.html"
echo "✔ created $OUT_DIR/index.html"
echo ""
echo "next steps:"
echo " open $OUT_DIR/index.html"
echo " # press T to cycle themes, ← → to navigate, O for overview"
echo ""
echo " # render to PNG:"
echo " $HERE/scripts/render.sh $OUT_DIR/index.html all"