218 lines
5.8 KiB
JavaScript
218 lines
5.8 KiB
JavaScript
|
|
/**
|
||
|
|
* 프레젠테이션 생성 인터페이스
|
||
|
|
* Enhanced PPTX Generator 모듈을 쉽게 사용할 수 있는 래퍼 함수
|
||
|
|
*/
|
||
|
|
|
||
|
|
const { EnhancedPPTXGenerator, createJoCodingPresentation } = require('./.claude/skills/pptx-skill/scripts/enhanced-pptx-generator.js');
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 조코딩 프레젠테이션 생성 (간편 사용)
|
||
|
|
*/
|
||
|
|
async function createJoCoding(filename = '조코딩_프레젠테이션.pptx') {
|
||
|
|
console.log('🎨 조코딩 프레젠테이션을 생성하고 있습니다...');
|
||
|
|
|
||
|
|
const result = await createJoCodingPresentation({ filename });
|
||
|
|
|
||
|
|
console.log(`✅ 생성 완료: ${result.filename}`);
|
||
|
|
console.log(`📊 슬라이드 수: ${result.slideCount}개`);
|
||
|
|
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 커스텀 프레젠테이션 생성
|
||
|
|
*/
|
||
|
|
async function createCustomPresentation(config) {
|
||
|
|
const {
|
||
|
|
title = 'My Presentation',
|
||
|
|
author = 'Author',
|
||
|
|
brandColor = '0066CC',
|
||
|
|
filename = 'presentation.pptx',
|
||
|
|
slides = []
|
||
|
|
} = config;
|
||
|
|
|
||
|
|
console.log(`🎨 "${title}" 프레젠테이션을 생성하고 있습니다...`);
|
||
|
|
|
||
|
|
const generator = new EnhancedPPTXGenerator({
|
||
|
|
title,
|
||
|
|
author,
|
||
|
|
brandColor
|
||
|
|
});
|
||
|
|
|
||
|
|
// 슬라이드 생성
|
||
|
|
for (const slideConfig of slides) {
|
||
|
|
switch (slideConfig.type) {
|
||
|
|
case 'title':
|
||
|
|
generator.createTitleSlide(
|
||
|
|
slideConfig.mainTitle,
|
||
|
|
slideConfig.subtitle,
|
||
|
|
slideConfig.description,
|
||
|
|
slideConfig.options
|
||
|
|
);
|
||
|
|
break;
|
||
|
|
|
||
|
|
case 'content':
|
||
|
|
generator.createContentSlide(
|
||
|
|
slideConfig.title,
|
||
|
|
slideConfig.items,
|
||
|
|
slideConfig.options
|
||
|
|
);
|
||
|
|
break;
|
||
|
|
|
||
|
|
case 'stats':
|
||
|
|
generator.createStatsSlide(
|
||
|
|
slideConfig.title,
|
||
|
|
slideConfig.stats,
|
||
|
|
slideConfig.options
|
||
|
|
);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const result = await generator.save(filename);
|
||
|
|
|
||
|
|
console.log(`✅ 생성 완료: ${result.filename}`);
|
||
|
|
console.log(`📊 슬라이드 수: ${result.slideCount}개`);
|
||
|
|
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 간단한 프레젠테이션 생성 (빠른 시작용)
|
||
|
|
*/
|
||
|
|
async function quickPresentation(title, content = [], filename) {
|
||
|
|
const slides = [
|
||
|
|
{
|
||
|
|
type: 'title',
|
||
|
|
mainTitle: title,
|
||
|
|
subtitle: 'Generated Presentation',
|
||
|
|
description: '자동 생성된 프레젠테이션'
|
||
|
|
}
|
||
|
|
];
|
||
|
|
|
||
|
|
// 콘텐츠가 배열이면 각각을 슬라이드로 변환
|
||
|
|
if (Array.isArray(content)) {
|
||
|
|
content.forEach((item, index) => {
|
||
|
|
slides.push({
|
||
|
|
type: 'content',
|
||
|
|
title: item.title || `슬라이드 ${index + 2}`,
|
||
|
|
items: item.items || [
|
||
|
|
{
|
||
|
|
icon: '📝',
|
||
|
|
title: item.title || '콘텐츠',
|
||
|
|
description: item.description || '내용을 추가하세요'
|
||
|
|
}
|
||
|
|
]
|
||
|
|
});
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
return await createCustomPresentation({
|
||
|
|
title,
|
||
|
|
filename: filename || `${title.replace(/[^a-zA-Z0-9가-힣]/g, '_')}.pptx`,
|
||
|
|
slides
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
// 사용 예제들
|
||
|
|
const examples = {
|
||
|
|
// 조코딩 프레젠테이션 생성
|
||
|
|
jocoding: async () => {
|
||
|
|
return await createJoCoding('조코딩_프레젠테이션_예제.pptx');
|
||
|
|
},
|
||
|
|
|
||
|
|
// 커스텀 프레젠테이션 생성
|
||
|
|
custom: async () => {
|
||
|
|
return await createCustomPresentation({
|
||
|
|
title: '나만의 프레젠테이션',
|
||
|
|
author: '사용자',
|
||
|
|
brandColor: '009900',
|
||
|
|
filename: '커스텀_프레젠테이션.pptx',
|
||
|
|
slides: [
|
||
|
|
{
|
||
|
|
type: 'title',
|
||
|
|
mainTitle: '프로젝트 소개',
|
||
|
|
subtitle: 'My Amazing Project',
|
||
|
|
description: '혁신적인 솔루션 제안'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
type: 'content',
|
||
|
|
title: '주요 기능',
|
||
|
|
items: [
|
||
|
|
{ icon: '⚡', title: '빠른 성능', description: '최적화된 알고리즘' },
|
||
|
|
{ icon: '🔒', title: '보안', description: '강화된 보안 시스템' },
|
||
|
|
{ icon: '🎨', title: '디자인', description: '사용자 친화적 인터페이스' },
|
||
|
|
{ icon: '📱', title: '모바일', description: '반응형 디자인' }
|
||
|
|
]
|
||
|
|
},
|
||
|
|
{
|
||
|
|
type: 'stats',
|
||
|
|
title: '성과 지표',
|
||
|
|
stats: [
|
||
|
|
{ number: '50%', description: '성능 향상', icon: '📈', color: 'FF0000' },
|
||
|
|
{ number: '1,000+', description: '사용자', icon: '👥', color: '0066CC' },
|
||
|
|
{ number: '99.9%', description: '가용성', icon: '✅', color: '00AA00' }
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
});
|
||
|
|
},
|
||
|
|
|
||
|
|
// 빠른 프레젠테이션 생성
|
||
|
|
quick: async () => {
|
||
|
|
return await quickPresentation('빠른 시작 가이드', [
|
||
|
|
{
|
||
|
|
title: '소개',
|
||
|
|
description: '프로젝트 개요 및 목표'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: '방법론',
|
||
|
|
description: '사용된 기술과 접근 방식'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: '결과',
|
||
|
|
description: '달성한 성과와 결과물'
|
||
|
|
}
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
// 명령줄에서 직접 실행할 수 있도록
|
||
|
|
async function main() {
|
||
|
|
const args = process.argv.slice(2);
|
||
|
|
const command = args[0] || 'jocoding';
|
||
|
|
|
||
|
|
try {
|
||
|
|
switch (command) {
|
||
|
|
case 'jocoding':
|
||
|
|
await examples.jocoding();
|
||
|
|
break;
|
||
|
|
case 'custom':
|
||
|
|
await examples.custom();
|
||
|
|
break;
|
||
|
|
case 'quick':
|
||
|
|
await examples.quick();
|
||
|
|
break;
|
||
|
|
default:
|
||
|
|
console.log('🎨 사용 가능한 명령어:');
|
||
|
|
console.log(' node create-presentation.js jocoding - 조코딩 프레젠테이션');
|
||
|
|
console.log(' node create-presentation.js custom - 커스텀 프레젠테이션');
|
||
|
|
console.log(' node create-presentation.js quick - 빠른 프레젠테이션');
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
} catch (error) {
|
||
|
|
console.error('❌ 오류:', error.message);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// 명령줄에서 실행된 경우에만 main 실행
|
||
|
|
if (require.main === module) {
|
||
|
|
main();
|
||
|
|
}
|
||
|
|
|
||
|
|
module.exports = {
|
||
|
|
createJoCoding,
|
||
|
|
createCustomPresentation,
|
||
|
|
quickPresentation,
|
||
|
|
examples
|
||
|
|
};
|