
make-pptx
by window-ook
๐คผโโ๏ธ ์ง์์์ ์ฑ์ฉ ๊ณต๊ณ ์ ์ ํฉ๋๋ฅผ ์๋ ค์ฃผ๋ ํ์ฒด์ปค์ ๋๋ค
SKILL.md
name: make-pptx description: HTML ๊ธฐ๋ฐ ํ๋ ์ ํ ์ด์ ์ PPTX ํ์ผ๋ก ๋ณํํ๊ฑฐ๋ ์ง์ PPTX ํ์ผ์ ์์ฑํ๋ ์คํฌ. Pretendard ํฐํธ ํ์ ์ ์ฉ. PptxGenJS ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํ์ฉ. allowed-tools: Read, Write, Edit, Bash, Glob user-invocable: true
PPTX ์์ฑ ์คํฌ
HTML ํ๋ ์ ํ ์ด์ ์ PPTX๋ก ๋ณํํ๊ฑฐ๋, PptxGenJS๋ฅผ ์ง์ ํ์ฉํ์ฌ PowerPoint ํ์ผ์ ์์ฑํฉ๋๋ค.
ํ์ ์๊ตฌ์ฌํญ
Pretendard ํฐํธ
๋ชจ๋ PPTX ํ์ผ์ ๋ฐ๋์ Pretendard ํฐํธ๋ฅผ ์ฌ์ฉํด์ผ ํฉ๋๋ค.
์์คํ ์ Pretendard๊ฐ ์๋ ๊ฒฝ์ฐ:
- https://github.com/orioncactus/pretendard ์์ ๋ค์ด๋ก๋
- ์์คํ ์ ํฐํธ ์ค์น
์์กด์ฑ
npm install pptxgenjs sharp
์ํฌํ๋ก์ฐ
์ต์ 1: PptxGenJS ์ง์ ์ฌ์ฉ (๊ถ์ฅ)
PptxGenJS๋ฅผ ์ฌ์ฉํ์ฌ ํ๋ก๊ทธ๋๋งคํฑํ๊ฒ PPTX๋ฅผ ์์ฑํฉ๋๋ค.
๊ธฐ๋ณธ ๊ตฌ์กฐ
const PptxGenJS = require('pptxgenjs');
// ํ๋ ์ ํ
์ด์
์์ฑ
const pptx = new PptxGenJS();
// ๋ฉํ๋ฐ์ดํฐ ์ค์
pptx.author = 'Fit Checker';
pptx.title = '์ ํฉ์ฑ ๋ถ์ ๋ฆฌํฌํธ';
pptx.subject = '[ํ์ฌ๋ช
] x [์ง์์๋ช
]';
// ๋ ์ด์์ ์ค์ (16:9)
pptx.defineLayout({ name: 'CUSTOM', width: 13.33, height: 7.5 });
pptx.layout = 'CUSTOM';
์ฌ๋ผ์ด๋ 1: ํ์ดํ & ๋งค์น์จ
const slide1 = pptx.addSlide();
// ๋ฐฐ๊ฒฝ์
slide1.background = { color: 'F9FAFB' };
// ํ์ดํ
slide1.addText('[ํ์ฌ๋ช
] x [์ง์์๋ช
]', {
x: 0.5,
y: 0.5,
w: '90%',
h: 1,
fontSize: 40,
fontFace: 'Pretendard',
bold: true,
color: '111827',
align: 'center',
});
// ์๋ธํ์ดํ
slide1.addText('์ ํฉ์ฑ ๋ถ์ ๋ฆฌํฌํธ', {
x: 0.5,
y: 1.3,
w: '90%',
h: 0.5,
fontSize: 24,
fontFace: 'Pretendard',
color: '6B7280',
align: 'center',
});
// ๋งค์น์จ ์ํ (๋๋ ์ฐจํธ)
slide1.addChart(
pptx.ChartType.doughnut,
[
{
name: 'Match',
labels: ['๋งค์น', '๋๋จธ์ง'],
values: [78, 22], // ๋งค์น์จ์ ๋ฐ๋ผ ์กฐ์
},
],
{
x: 4.5,
y: 2,
w: 4,
h: 4,
chartColors: ['10B981', 'E5E7EB'],
showLegend: false,
showTitle: false,
holeSize: 70,
}
);
// ๋งค์น์จ ํ
์คํธ (์ฐจํธ ์ค์)
slide1.addText('78%', {
x: 5.5,
y: 3.5,
w: 2,
h: 1,
fontSize: 48,
fontFace: 'Pretendard',
bold: true,
color: '10B981',
align: 'center',
});
์ฌ๋ผ์ด๋ 2: ์ ๋ง๋ ์
const slide2 = pptx.addSlide();
slide2.addText('โ
์ ๋ง๋ ์ ', {
x: 0.5,
y: 0.3,
w: '90%',
fontSize: 32,
fontFace: 'Pretendard',
bold: true,
color: '111827',
});
// ํ
์ด๋ธ ๋ฐ์ดํฐ
const tableData = [
[
{ text: 'ํญ๋ชฉ', options: { bold: true, fill: '2563EB', color: 'FFFFFF' } },
{
text: 'ํ์ฌ ์๊ตฌ์ฌํญ',
options: { bold: true, fill: '2563EB', color: 'FFFFFF' },
},
{
text: '์ง์์ ๋ณด์ ์ญ๋',
options: { bold: true, fill: '2563EB', color: 'FFFFFF' },
},
{
text: '์ ํฉ๋',
options: { bold: true, fill: '2563EB', color: 'FFFFFF' },
},
],
[
{ text: '๊ธฐ์ ์คํ' },
{ text: 'React, TypeScript' },
{ text: 'Next.js, React, TypeScript' },
{ text: 'โ
์๋ฒฝ ์ผ์น', options: { color: '10B981' } },
],
// ์ถ๊ฐ ํ...
];
slide2.addTable(tableData, {
x: 0.5,
y: 1,
w: 12,
fontFace: 'Pretendard',
fontSize: 14,
border: { type: 'solid', pt: 1, color: 'E5E7EB' },
align: 'left',
valign: 'middle',
});
์ฌ๋ผ์ด๋ 3: ๋ง์ง ์๋ ์
const slide3 = pptx.addSlide();
slide3.addText('โ ๏ธ ๋ง์ง ์๋ ์ ', {
x: 0.5,
y: 0.3,
w: '90%',
fontSize: 32,
fontFace: 'Pretendard',
bold: true,
color: '111827',
});
// ์นด๋ ์คํ์ผ ๋ฐ์ค
slide3.addShape(pptx.ShapeType.rect, {
x: 0.5,
y: 1,
w: 5.5,
h: 2.5,
fill: 'FEF2F2',
line: { color: 'EF4444', pt: 2, dashType: 'solid' },
});
slide3.addText('โ ๊ฒฝ๋ ฅ ์๊ฑด', {
x: 0.7,
y: 1.2,
w: 5,
fontSize: 20,
fontFace: 'Pretendard',
bold: true,
color: 'EF4444',
});
slide3.addText('์๊ตฌ: 3๋
์ด์\n๋ณด์ : ์ ์
', {
x: 0.7,
y: 1.8,
w: 5,
fontSize: 16,
fontFace: 'Pretendard',
color: '111827',
});
์ฌ๋ผ์ด๋ 4: ๋ณด์ ํฌ์ธํธ
const slide4 = pptx.addSlide();
slide4.addText('๐ก ๋ณด์ ํฌ์ธํธ', {
x: 0.5,
y: 0.3,
w: '90%',
fontSize: 32,
fontFace: 'Pretendard',
bold: true,
color: '111827',
});
// ์ฐ์ ์์ ๋ฐฐ์ง
slide4.addShape(pptx.ShapeType.roundRect, {
x: 0.5,
y: 1,
w: 1.2,
h: 0.4,
fill: 'FEE2E2',
});
slide4.addText('๋์', {
x: 0.5,
y: 1,
w: 1.2,
h: 0.4,
fontSize: 12,
fontFace: 'Pretendard',
bold: true,
color: '991B1B',
align: 'center',
valign: 'middle',
});
// ๋ณด์ ํญ๋ชฉ ๋ด์ฉ
slide4.addText('[๋ณด์ ํญ๋ชฉ๋ช
]', {
x: 2,
y: 1,
w: 10,
fontSize: 18,
fontFace: 'Pretendard',
bold: true,
color: '111827',
});
slide4.addText('๐ ๊ทผ๊ฑฐ: [์ฑ์ฉ ๊ณต๊ณ ์์ ๋ฐ์ทํ ๊ทผ๊ฑฐ]', {
x: 2,
y: 1.6,
w: 10,
fontSize: 14,
fontFace: 'Pretendard',
color: '6B7280',
});
ํ์ผ ์ ์ฅ
// ํ์ผ๋ก ์ ์ฅ (Node.js)
pptx
.writeFile({ fileName: 'output/fit-result.pptx' })
.then((fileName) => console.log(`Created: ${fileName}`));
// ๋๋ Buffer๋ก ๋ฐํ
const buffer = await pptx.write({ outputType: 'nodebuffer' });
์ต์ 2: HTML to PPTX ๋ณํ
HTML ํ์ผ์ PPTX๋ก ๋ณํํด์ผ ํ๋ ๊ฒฝ์ฐ, html2pptx.md ์ฐธ์กฐ ๋ฌธ์๋ฅผ ํ์ธํ์ธ์.
์ค์ ์ฃผ์์ฌํญ
1. ์์ ์ฝ๋
PptxGenJS์์ # ์์ด ์ฌ์ฉํด์ผ ํฉ๋๋ค.
// โ
์ฌ๋ฐ๋ฆ
{
color: '10B981';
}
{
fill: 'F9FAFB';
}
// โ ์๋ชป๋จ (ํ์ผ ์์ ๊ฐ๋ฅ)
{
color: '#10B981';
}
{
fill: '#F9FAFB';
}
2. ํฐํธ ์ง์
๋ชจ๋ ํ ์คํธ ์์์ Pretendard ํฐํธ๋ฅผ ๋ช ์์ ์ผ๋ก ์ง์ :
{
fontFace: 'Pretendard',
// ...
}
3. ํ๊ธ ํ ์คํธ
ํ๊ธ ํ
์คํธ๋ ์๋์ผ๋ก ์ฒ๋ฆฌ๋์ง๋ง, ์ค๋ฐ๊ฟ์ด ํ์ํ ๊ฒฝ์ฐ \n ์ฌ์ฉ:
slide.addText('์ฒซ ๋ฒ์งธ ์ค\n๋ ๋ฒ์งธ ์ค', { ... });
4. ์ด๋ชจ์ง ์ฌ์ฉ
์ด๋ชจ์ง๋ ์ผ๋ถ ํ๊ฒฝ์์ ํ์๋์ง ์์ ์ ์์ต๋๋ค. ์ค์ํ ์ ๋ณด๋ ์ด๋ชจ์ง ์ธ์ ํ ์คํธ๋ก๋ ํํํ์ธ์.
์ถ๋ ฅ ํ์ผ
๊ฒฐ๊ณผ๋ฌผ์ output/ ๋๋ ํ ๋ฆฌ์ ์ ์ฅ:
output/
โโโ fit-check-result-YYYY-MM-DD.pptx
โโโ fit-check-result-YYYY-MM-DD.html (๋ฐฑ์
์ฉ)
์ปฌ๋ฌ ํ๋ ํธ ์ฐธ์กฐ
| ์ฉ๋ | ์์ ์ฝ๋ | ์ค๋ช |
|---|---|---|
| Primary | 2563EB | ์ฃผ์ ๊ฐ์กฐ์ |
| Success | 10B981 | ๊ธ์ ์ /์๋ฃ |
| Warning | F59E0B | ์ฃผ์/์ ํธ |
| Danger | EF4444 | ๋ถ์ ์ /ํ์ ๋ฏธ์ถฉ์กฑ |
| Neutral | 6B7280 | ์ค๋ฆฝ/๋ณด์กฐ ํ ์คํธ |
| Background | F9FAFB | ๋ฐฐ๊ฒฝ์ |
| Text Primary | 111827 | ์ฃผ์ ํ ์คํธ |
| Text Secondary | 6B7280 | ๋ณด์กฐ ํ ์คํธ |
| Border | E5E7EB | ํ ๋๋ฆฌ/๊ตฌ๋ถ์ |
์ถ๊ฐ ์ฐธ์กฐ ๋ฌธ์
์์ธํ ๊ธฐ์ ์ ๋ณด๋ ๋ค์ ๋ฌธ์๋ฅผ ์ฐธ์กฐํ์ธ์:
html2pptx.md- HTML to PPTX ๋ณํ ์์ธ ๊ฐ์ด๋ooxml.md- OOXML ์ง์ ์กฐ์ ๊ธฐ์ ์ฐธ์กฐ
Score
Total Score
Based on repository quality metrics
SKILL.mdใใกใคใซใๅซใพใใฆใใ
ใฉใคใปใณในใ่จญๅฎใใใฆใใ
100ๆๅญไปฅไธใฎ่ชฌๆใใใ
GitHub Stars 100ไปฅไธ
3ใถๆไปฅๅ ใซๆดๆฐใใใ
10ๅไปฅไธใใฉใผใฏใใใฆใใ
ใชใผใใณIssueใ50ๆชๆบ
ใใญใฐใฉใใณใฐ่จ่ชใ่จญๅฎใใใฆใใ
1ใคไปฅไธใฎใฟใฐใ่จญๅฎใใใฆใใ
Reviews
Reviews coming soon