HTML 슬라이드를 PowerPoint(PPTX) 파일로 변환. PPTX 생성, 편집, 썸네일 생성이 필요할 때 사용.
HTML 슬라이드를 PowerPoint 프레젠테이션 파일로 변환하는 스킬입니다.
HTML 슬라이드 파일들을 PowerPoint로 변환
PPTX 파일의 내용 수정
프레젠테이션의 미리보기 이미지 생성
HTML 슬라이드 준비
slides/ 디렉토리에 HTML 파일들 확인html2pptx.js 실행
node .claude/skills/pptx-skill/scripts/html2pptx.js
결과 검증
HTML 파일들을 PPTX로 변환
import { html2pptx } from './.claude/skills/pptx-skill/scripts/html2pptx.js';
import PptxGenJS from 'pptxgenjs';
const pres = new PptxGenJS();
pres.layout = 'LAYOUT_WIDE'; // 16:9
// 각 슬라이드 변환
await html2pptx('slides/slide-01.html', pres);
await html2pptx('slides/slide-02.html', pres);
// 저장
await pres.writeFile({ fileName: 'presentation.pptx' });
프레젠테이션 썸네일 그리드 생성
python .claude/skills/pptx-skill/scripts/thumbnail.py presentation.pptx output-thumbnail
옵션:
--cols N: 열 수 (기본 5, 범위 3-6)--outline-placeholders: 플레이스홀더 영역 표시PPTX 파일 패키징/언패키징
# 언패킹
python .claude/skills/pptx-skill/ooxml/scripts/unpack.py presentation.pptx output_dir
# 패킹
python .claude/skills/pptx-skill/ooxml/scripts/pack.py input_dir presentation.pptx
PPTX 구조 검증
python .claude/skills/pptx-skill/ooxml/scripts/validate.py unpacked_dir --original presentation.pptx
// 올바른 사용 - # 없이
{ color: 'FF0000' }
// 잘못된 사용 - 파일 손상 유발
{ color: '#FF0000' }
const slide = pres.addSlide();
// 텍스트 추가
slide.addText('제목', {
x: 0.5,
y: 0.5,
w: 9,
h: 1,
fontSize: 36,
color: '1a1a2e',
bold: true
});
// 이미지 추가
slide.addImage({
path: 'image.png',
x: 1,
y: 2,
w: 4,
h: 3
});
// 도형 추가
slide.addShape(pres.ShapeType.rect, {
x: 0.5,
y: 1,
w: 3,
h: 2,
fill: { color: '1e3a5f' }
});
// 막대 차트
slide.addChart(pres.ChartType.bar, [
{
name: '시리즈 1',
labels: ['A', 'B', 'C'],
values: [10, 20, 30]
}
], {
x: 1,
y: 2,
w: 8,
h: 4
});
// 원형 차트
slide.addChart(pres.ChartType.pie, [...], {...});
// 선형 차트
slide.addChart(pres.ChartType.line, [...], {...});
┌─────────────────┐
│ HTML 슬라이드 │
│ slides/*.html │
└────────┬────────┘
│
▼
┌─────────────────┐
│ html2pptx.js │
│ (Playwright + │
│ PptxGenJS) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ PPTX 파일 │
│ presentation. │
│ pptx │
└────────┬────────┘
│
▼
┌─────────────────┐
│ thumbnail.py │
│ (미리보기) │
└─────────────────┘