docs(P3a): inline images for self-contained HTML (REQ-268)

New scripts/inline_images.py (stdlib only: base64, re, mimetypes) —
base64-embeds all relative-path <img src='assets/...'> images into
the rendered HTML so it's redistributable without the assets/ folder.
MIME-sniffs by extension (.png->image/png, .svg->image/svg+xml, etc).
render_slides.sh Step 3 invokes it after the MARP HTML render, before
staging. Verified: 2 images inlined, 0 file-path refs remaining.

---ci---
project: acdl
phase: 3
milestone: v1.23
status: execute
phase_role: execution
---/ci---
This commit is contained in:
Jon Chery
2026-08-12 00:17:19 +00:00
parent df426afd6a
commit 485d105bcd
4 changed files with 84 additions and 5 deletions
+10 -3
View File
@@ -2,7 +2,8 @@
# scripts/render_slides.sh — render the Nova presentation deck end-to-end:
# 1. Mermaid .mmd → .png (S&P-themed via sp-theme.json)
# 2. Marp .md → .html + .pptx (S&P-themed via inline style: block in frontmatter)
# 3. Stage all rendered artifacts to git.
# 3. Inline images → base64-embed all images in the HTML (self-contained).
# 4. Stage all rendered artifacts to git.
#
# Usage:
# bash scripts/render_slides.sh [deck-name]
@@ -71,7 +72,13 @@ echo " PPTX → $PPTX"
npx --yes @marp-team/marp-cli@4.5.0 --allow-local-files "$SRC" -o "$PPTX" 2>&1 | tail -3
echo ""
# --- Step 3: stage ---
echo "=== Step 3: Staging rendered artifacts ==="
# --- Step 3: inline images into HTML (base64-embed for redistribution) ---
# REQ-268: makes the HTML self-contained (no assets/ folder needed).
echo "=== Step 3: Inlining images into HTML ==="
python3 scripts/inline_images.py "$HTML" 2>&1
echo ""
# --- Step 4: stage ---
echo "=== Step 4: Staging rendered artifacts ==="
git add "$PNG_DIR"/*.png "$HTML" "$PPTX" 2>/dev/null || true
echo "=== Done: staged $(ls "$PNG_DIR"/*.png 2>/dev/null | wc -l) PNGs + $HTML + $PPTX ==="