first-commit
ci / Validate workspace (push) Has been cancelled
landing-page-ci / Validate landing page (push) Has been cancelled
landing-page-deploy / Deploy landing page (push) Has been cancelled
github-metrics / Generate repository metrics SVG (push) Has been cancelled
refresh-contributors-wall / Refresh contributors wall cache bust (push) Waiting to run
@@ -0,0 +1,46 @@
|
||||
#!/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"
|
||||
@@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
# html-ppt :: render.sh — headless Chrome screenshot(s)
|
||||
#
|
||||
# Usage:
|
||||
# render.sh <html-file> # one PNG, slide 1
|
||||
# render.sh <html-file> <N> # N PNGs, slides 1..N, via #/k
|
||||
# render.sh <html-file> all # autodetect .slide count
|
||||
# render.sh <html-file> <N> <out-dir> # custom output dir
|
||||
#
|
||||
# Requires: Google Chrome at /Applications/Google Chrome.app (macOS).
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
|
||||
if [[ ! -x "$CHROME" ]]; then
|
||||
echo "error: Chrome not found at $CHROME" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FILE="${1:-}"
|
||||
if [[ -z "$FILE" ]]; then
|
||||
echo "usage: render.sh <html> [N|all] [out-dir]" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -f "$FILE" ]]; then
|
||||
echo "error: $FILE not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
COUNT="${2:-1}"
|
||||
OUT="${3:-}"
|
||||
|
||||
ABS="$(cd "$(dirname "$FILE")" && pwd)/$(basename "$FILE")"
|
||||
STEM="$(basename "${FILE%.*}")"
|
||||
|
||||
if [[ "$COUNT" == "all" ]]; then
|
||||
COUNT="$(grep -c 'class="slide"' "$FILE" || true)"
|
||||
[[ -z "$COUNT" || "$COUNT" -lt 1 ]] && COUNT=1
|
||||
fi
|
||||
|
||||
if [[ -z "$OUT" ]]; then
|
||||
if [[ "$COUNT" -gt 1 ]]; then
|
||||
OUT="$(dirname "$FILE")/${STEM}-png"
|
||||
mkdir -p "$OUT"
|
||||
fi
|
||||
fi
|
||||
|
||||
render_one() {
|
||||
local url="$1" target="$2"
|
||||
"$CHROME" \
|
||||
--headless=new \
|
||||
--disable-gpu \
|
||||
--hide-scrollbars \
|
||||
--no-sandbox \
|
||||
--virtual-time-budget=4000 \
|
||||
--window-size=1920,1080 \
|
||||
--screenshot="$target" \
|
||||
"$url" >/dev/null 2>&1
|
||||
echo " ✔ $target"
|
||||
}
|
||||
|
||||
if [[ "$COUNT" == "1" ]]; then
|
||||
OUT_FILE="${OUT:-$(dirname "$FILE")/${STEM}.png}"
|
||||
render_one "file://$ABS" "$OUT_FILE"
|
||||
else
|
||||
for i in $(seq 1 "$COUNT"); do
|
||||
render_one "file://$ABS#/$i" "$OUT/${STEM}_$(printf '%02d' "$i").png"
|
||||
done
|
||||
fi
|
||||
|
||||
echo "done: rendered $COUNT slide(s) from $FILE"
|
||||
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 316 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 140 KiB |
|
After Width: | Height: | Size: 207 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 170 KiB |
|
After Width: | Height: | Size: 248 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 190 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 152 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 78 KiB |