Files
langchain-evolution-deck/slides/section5-ecosystem/_render_previews.py
T
petya 75601988c2 Initial commit: LangChain evolution tutorial deck (132 slides)
- Cover, TOC, 5 dividers, 3 recap slides
- 5 sections (chains, langgraph, deepagents, openswe, ecosystem)
- design-system.js with theme tokens + 9 helper functions
- research/: timeline + sources + per-tech notes
- final-compile.js + merge.js for rebuild pipeline
- output/: langchain-evolution.pptx (2.3 MB) + langchain-evolution.pdf (1.1 MB) + 7 sample previews
2026-06-22 11:29:03 +03:00

21 lines
813 B
Python

#!/usr/bin/env python3
"""Re-render section5 PDF -> PNG previews. Wipes stale PNGs via mavis-trash."""
from pdf2image import convert_from_path
from pathlib import Path
import subprocess
src = Path('/Users/alexandr/.mavis/plans/plan_85053139/workspace/lc-evo-deck/slides/section5-ecosystem/section5.pdf')
out = Path('/Users/alexandr/.mavis/plans/plan_85053139/workspace/lc-evo-deck/slides/section5-ecosystem/previews')
out.mkdir(parents=True, exist_ok=True)
# Move stale PNGs to trash via mavis-trash
stale = sorted(out.glob('slide-*.png'))
if stale:
subprocess.run(['mavis-trash', *[str(p) for p in stale]], check=False)
imgs = convert_from_path(str(src), dpi=110)
for i, im in enumerate(imgs, 1):
p = out / f'slide-{i:02d}.png'
im.save(str(p), 'PNG')
print(f'wrote {len(imgs)} previews to {out}')