Loading...
Loading...
Convert HTML slide templates to JSON+HTML format. Invoke when generating JSON data for beauty-normal command or converting existing HTML examples to JSON-driven templates.
npx skill4agent add within-7/minto-plugin-tools beauty-jsonbeauty-html/assets/beauty-normal{
"presentation": {
"meta": {
"title": "演示文稿标题",
"subtitle": "副标题",
"author": "作者",
"date": "日期"
},
"slides": [
{
"id": 1,
"type": "cover|toc|section|content|end",
"template": "01-cover-page|02-two-column|03-three-column|05-chart-text|...",
"title": "幻灯片标题",
"content": { ... }
}
]
}
}{
"id": 1,
"type": "cover",
"template": "01-cover-page",
"title": "封面页",
"content": {
"mainTitle": "跨境垂直平台战略报告",
"subtitle": "平台模式 vs 个人IP模式深度分析",
"meta": {
"date": "2026年1月",
"author": "战略分析团队"
}
}
}{
"id": 2,
"type": "content",
"template": "02-two-column-comparison",
"title": "平台模式 vs 个人IP模式",
"content": {
"leftColumn": {
"title": "平台模式",
"items": [
"可复制性强,易于规模化",
"网络效应明显,壁垒高",
"生态闭环,数据价值高",
"资本吸引力强,估值高",
"运营复杂度高,投入大",
"冷启动困难,需要临界规模"
],
"highlight": "适合:有资本、有资源、追求规模"
},
"rightColumn": {
"title": "个人IP模式",
"items": [
"启动快,成本低",
"个人影响力强,粘性高",
"灵活性强,转型容易",
"现金流稳定,风险低",
"规模化困难,天花板低",
"个人依赖强,不易复制"
],
"highlight": "适合:个人创业者、内容创作者"
}
}
}{
"id": 3,
"type": "content",
"template": "03-three-column",
"title": "三大核心策略",
"content": {
"columns": [
{
"title": "策略一",
"items": ["要点1", "要点2", "要点3"],
"icon": "📊"
},
{
"title": "策略二",
"items": ["要点1", "要点2", "要点3"],
"icon": "🎯"
},
{
"title": "策略三",
"items": ["要点1", "要点2", "要点3"],
"icon": "💡"
}
]
}
}{
"id": 4,
"type": "content",
"template": "05-chart-text",
"title": "六大平台收入增长对比",
"content": {
"chart": {
"type": "bar",
"title": "2024年收入对比",
"data": {
"labels": ["GrowthBi", "Finder", "Foundy", "Clarity", "Panda", "Omega"],
"datasets": [{
"label": "年收入(百万美元)",
"data": [120, 95, 88, 45, 35, 28],
"backgroundColor": [
"rgba(248, 93, 66, 0.8)",
"rgba(85, 110, 230, 0.8)",
"rgba(80, 165, 241, 0.8)",
"rgba(52, 195, 143, 0.8)",
"rgba(241, 180, 76, 0.8)",
"rgba(116, 120, 141, 0.8)"
]
}]
},
"options": {
"responsive": true,
"maintainAspectRatio": false
}
},
"insights": [
"GrowthBi引领增长,年增长率达120%",
"Finder和Foundy保持稳健增长(80-90%)",
"传统平台增长乏力,增速低于50%",
"会员订阅模式是增长核心驱动力",
"高客单价服务贡献主要利润"
],
"highlight": "启示:会员订阅(稳定现金流)+ 高客单价服务(利润来源)是最佳商业模式"
}
}{
"id": 5,
"type": "toc",
"template": "08-table-of-contents",
"title": "目录",
"content": {
"items": [
{ "number": "01", "title": "市场分析", "page": 3 },
{ "number": "02", "title": "竞争格局", "page": 8 },
{ "number": "03", "title": "战略建议", "page": 15 },
{ "number": "04", "title": "实施路径", "page": 22 }
]
}
}{
"id": 6,
"type": "section",
"template": "11-chapter-overview",
"title": "第一章 市场分析",
"content": {
"subtitle": "市场规模与增长趋势",
"description": "深入分析当前市场状况,识别关键增长机会"
}
}{
"id": 7,
"type": "content",
"template": "06-data-emphasis",
"title": "关键数据",
"content": {
"metrics": [
{
"value": "120%",
"label": "年增长率",
"description": "市场高速增长"
},
{
"value": "$5.2B",
"label": "市场规模",
"description": "2024年市场规模"
},
{
"value": "85%",
"label": "市场份额",
"description": "头部企业占比"
}
]
}
}<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>McKinsey风格演示文稿</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
<style>
/* CSS样式 - McKinsey规范 */
</style>
</head>
<body>
<div id="presentation-container"></div>
<script>
// JSON数据
const presentationData = {
"presentation": {
"meta": { ... },
"slides": [ ... ]
}
};
// 渲染函数
function renderPresentation(data) {
const container = document.getElementById('presentation-container');
// 渲染逻辑
}
// 初始化
document.addEventListener('DOMContentLoaded', function() {
renderPresentation(presentationData);
});
</script>
</body>
</html>function renderCoverPage(content) {
return `
<div class="slide cover-page">
<div class="cover-content">
<h1>${content.mainTitle}</h1>
<div class="divider"></div>
<p class="subtitle">${content.subtitle}</p>
<div class="meta-info">
<p>报告日期:${content.meta.date}</p>
<p>作者:${content.meta.author}</p>
</div>
</div>
</div>
`;
}function renderTwoColumnPage(content) {
return `
<div class="slide two-column-page">
<div class="slide-header">
<h2>${content.title}</h2>
</div>
<div class="comparison-container">
<div class="column left">
<div class="column-header">${content.leftColumn.title}</div>
<ul class="column-content">
${content.leftColumn.items.map(item => `<li>${item}</li>`).join('')}
</ul>
<div class="highlight-box">
💡 ${content.leftColumn.highlight}
</div>
</div>
<div class="column right">
<div class="column-header">${content.rightColumn.title}</div>
<ul class="column-content">
${content.rightColumn.items.map(item => `<li>${item}</li>`).join('')}
</ul>
<div class="highlight-box">
💡 ${content.rightColumn.highlight}
</div>
</div>
</div>
</div>
`;
}function renderChartTextPage(content, slideId) {
const canvasId = `chart-${slideId}`;
return `
<div class="slide chart-text-page">
<div class="slide-header">
<h2>${content.title}</h2>
</div>
<div class="chart-text-container">
<div class="chart-section">
<div class="chart-container">
<canvas id="${canvasId}"></canvas>
</div>
</div>
<div class="text-section">
<div class="insight-title">关键洞察</div>
<ul class="insight-list">
${content.insights.map(insight => `<li>${insight}</li>`).join('')}
</ul>
<div class="highlight-box">
<p>💡 ${content.highlight}</p>
</div>
</div>
</div>
</div>
`;
}function readHTMLTemplate(templateName) {
const templatePath = `beauty-html/assets/${templateName}.html`;
// 读取HTML文件内容
}| Template File | Template Type | JSON Structure |
|---|---|---|
| 01-cover-page.html | Cover Page | cover |
| 02-two-column-comparison.html | Two-column Comparison | two-column |
| 03-three-column.html | Three-column Layout | three-column |
| 04-card-grid.html | Card Grid | card-grid |
| 05-chart-text.html | Chart + Text | chart-text |
| 06-data-emphasis.html | Data Emphasis | data-emphasis |
| 08-table-of-contents.html | Table of Contents | toc |
| 11-chapter-overview.html | Section Home Page | section |
| 12-traffic-analysis.html | Traffic Analysis | chart-text |
| 13-user-positioning.html | User Positioning | chart-text |
| 14-user-demand-rating.html | User Demand Rating | chart-text |
01-cover-page.html{
"presentation": {
"slides": [{
"id": 1,
"type": "cover",
"template": "01-cover-page",
"title": "封面页",
"content": {
"mainTitle": "跨境垂直平台战略报告",
"subtitle": "平台模式 vs 个人IP模式深度分析",
"meta": {
"date": "2026年1月",
"author": "战略分析团队"
}
}
}]
}
}<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>McKinsey风格演示文稿</title>
<style>
/* 完整的CSS样式(从原HTML提取) */
</style>
</head>
<body>
<div id="presentation-container"></div>
<script>
const presentationData = { /* JSON数据 */ };
function renderCoverPage(content) {
return `
<div class="slide cover-page">
<div class="cover-content">
<h1>${content.mainTitle}</h1>
<div class="divider"></div>
<p class="subtitle">${content.subtitle}</p>
<div class="meta-info">
<p>报告日期:${content.meta.date}</p>
<p>作者:${content.meta.author}</p>
</div>
</div>
</div>
`;
}
function renderPresentation(data) {
const container = document.getElementById('presentation-container');
data.presentation.slides.forEach(slide => {
if (slide.type === 'cover') {
container.innerHTML += renderCoverPage(slide.content);
}
});
}
document.addEventListener('DOMContentLoaded', function() {
renderPresentation(presentationData);
});
</script>
</body>
</html>05-chart-text.html{
"presentation": {
"slides": [{
"id": 4,
"type": "content",
"template": "05-chart-text",
"title": "六大平台收入增长对比",
"content": {
"chart": {
"type": "bar",
"title": "2024年收入对比",
"data": {
"labels": ["GrowthBi", "Finder", "Foundy", "Clarity", "Panda", "Omega"],
"datasets": [{
"label": "年收入(百万美元)",
"data": [120, 95, 88, 45, 35, 28],
"backgroundColor": [
"rgba(248, 93, 66, 0.8)",
"rgba(85, 110, 230, 0.8)",
"rgba(80, 165, 241, 0.8)",
"rgba(52, 195, 143, 0.8)",
"rgba(241, 180, 76, 0.8)",
"rgba(116, 120, 141, 0.8)"
]
}]
},
"options": {
"responsive": true,
"maintainAspectRatio": false
}
},
"insights": [
"GrowthBi引领增长,年增长率达120%",
"Finder和Foundy保持稳健增长(80-90%)",
"传统平台增长乏力,增速低于50%",
"会员订阅模式是增长核心驱动力",
"高客单价服务贡献主要利润"
],
"highlight": "启示:会员订阅(稳定现金流)+ 高客单价服务(利润来源)是最佳商业模式"
}
}]
}
}1. After completing the currently executable part
2. Clearly state: "Due to token limits, the task is not completed, please enter 'continue' to get the remaining part"
3. Wait for the user to enter "continue"
4. Continue to execute the remaining steps
5. Repeat until the task is fully completedresponsive: truemaintainAspectRatio: falsewidth: 100% !importantStart
↓
Step 1: Read HTML sample file
├─ Read HTML file from beauty-html/assets/
├─ Parse HTML structure
└─ Extract CSS and JavaScript framework
↓
Step 2: Extract HTML framework
├─ Retain HTML structure
├─ Retain CSS styles
├─ Retain JavaScript framework
└─ Remove specific content data
↓
Step 3: Generate JSON data
├─ Extract all text content
├─ Identify data structure
├─ Organize JSON data
└─ Verify data integrity
↓
Step 4: Create JSON-driven HTML
├─ Integrate HTML framework
├─ Embed JSON data
├─ Implement rendering function
└─ Verify rendering effect
↓
Completed! Output JSON data and HTML files[template name]_data.json[template name]_template.html[template name]_complete.html