Loading...
Loading...
Compare original and translation side by side
{{PLACEHOLDERS}}{{PLACEHOLDERS}}deno run --allow-read scripts/analyze-template.ts corporate-template.pptx > inventory.json{
"filename": "corporate-template.pptx",
"slideCount": 10,
"textElements": [
{
"slideNumber": 1,
"shapeId": "shape-2",
"shapeName": "Title 1",
"placeholderType": "ctrTitle",
"position": { "x": 1.5, "y": 2.0, "w": 7.0, "h": 1.2 },
"paragraphs": [
{ "text": "{{TITLE}}", "fontSize": 44, "bold": true }
]
}
]
}deno run --allow-read scripts/analyze-template.ts corporate-template.pptx > inventory.json{
"filename": "corporate-template.pptx",
"slideCount": 10,
"textElements": [
{
"slideNumber": 1,
"shapeId": "shape-2",
"shapeName": "Title 1",
"placeholderType": "ctrTitle",
"position": { "x": 1.5, "y": 2.0, "w": 7.0, "h": 1.2 },
"paragraphs": [
{ "text": "{{TITLE}}", "fontSize": 44, "bold": true }
]
}
]
}replacements.json{
"textReplacements": [
{ "tag": "{{TITLE}}", "value": "Q4 2024 Results" },
{ "tag": "{{SUBTITLE}}", "value": "Financial Overview" },
{ "tag": "{{DATE}}", "value": "December 2024" },
{ "tag": "{{AUTHOR}}", "value": "Finance Team", "slideNumbers": [1] }
]
}replacements.json{
"textReplacements": [
{ "tag": "{{TITLE}}", "value": "Q4 2024 Results" },
{ "tag": "{{SUBTITLE}}", "value": "Financial Overview" },
{ "tag": "{{DATE}}", "value": "December 2024" },
{ "tag": "{{AUTHOR}}", "value": "Finance Team", "slideNumbers": [1] }
]
}deno run --allow-read --allow-write scripts/generate-from-template.ts \
corporate-template.pptx replacements.json output.pptxdeno run --allow-read --allow-write scripts/generate-from-template.ts \
corporate-template.pptx replacements.json output.pptxdeno run --allow-read scripts/generate-thumbnails.ts slide-library.pptxdeno run --allow-read --allow-write scripts/generate-thumbnails.ts \
slide-library.pptx --extract-thumb --output-dir ./previewsdeno run --allow-read scripts/generate-thumbnails.ts slide-library.pptxdeno run --allow-read --allow-write scripts/generate-thumbnails.ts \
slide-library.pptx --extract-thumb --output-dir ./previewsselections.json{
"slideSelections": [
{ "slideNumber": 1 },
{ "slideNumber": 5 },
{ "slideNumber": 12 },
{ "slideNumber": 3 }
],
"textReplacements": [
{ "tag": "{{TITLE}}", "value": "Custom Presentation" }
]
}selections.json{
"slideSelections": [
{ "slideNumber": 1 },
{ "slideNumber": 5 },
{ "slideNumber": 12 },
{ "slideNumber": 3 }
],
"textReplacements": [
{ "tag": "{{TITLE}}", "value": "Custom Presentation" }
]
}deno run --allow-read --allow-write scripts/generate-from-template.ts \
slide-library.pptx selections.json custom-deck.pptxdeno run --allow-read --allow-write scripts/generate-from-template.ts \
slide-library.pptx selections.json custom-deck.pptxspec.json{
"title": "Product Launch 2025",
"author": "Marketing Team",
"slides": [
{
"background": { "color": "003366" },
"elements": [
{
"type": "text",
"x": 1, "y": 2.5, "w": 8, "h": 1.5,
"options": {
"text": "Product Launch 2025",
"fontSize": 44,
"bold": true,
"color": "FFFFFF",
"align": "center"
}
},
{
"type": "text",
"x": 1, "y": 4, "w": 8, "h": 0.5,
"options": {
"text": "Revolutionizing the Industry",
"fontSize": 24,
"color": "CCCCCC",
"align": "center"
}
}
]
},
{
"elements": [
{
"type": "text",
"x": 0.5, "y": 0.5, "w": 9, "h": 0.7,
"options": {
"text": "Key Features",
"fontSize": 32,
"bold": true,
"color": "003366"
}
},
{
"type": "table",
"x": 0.5, "y": 1.5, "w": 9, "h": 3,
"options": {
"rows": [
["Feature", "Description", "Benefit"],
["Speed", "2x faster processing", "Save time"],
["Quality", "HD output", "Better results"],
["Integration", "Works with existing tools", "Easy adoption"]
],
"border": { "pt": 1, "color": "CCCCCC" }
}
}
]
}
]
}spec.json{
"title": "Product Launch 2025",
"author": "Marketing Team",
"slides": [
{
"background": { "color": "003366" },
"elements": [
{
"type": "text",
"x": 1, "y": 2.5, "w": 8, "h": 1.5,
"options": {
"text": "Product Launch 2025",
"fontSize": 44,
"bold": true,
"color": "FFFFFF",
"align": "center"
}
},
{
"type": "text",
"x": 1, "y": 4, "w": 8, "h": 0.5,
"options": {
"text": "Revolutionizing the Industry",
"fontSize": 24,
"color": "CCCCCC",
"align": "center"
}
}
]
},
{
"elements": [
{
"type": "text",
"x": 0.5, "y": 0.5, "w": 9, "h": 0.7,
"options": {
"text": "Key Features",
"fontSize": 32,
"bold": true,
"color": "003366"
}
},
{
"type": "table",
"x": 0.5, "y": 1.5, "w": 9, "h": 3,
"options": {
"rows": [
["Feature", "Description", "Benefit"],
["Speed", "2x faster processing", "Save time"],
["Quality", "HD output", "Better results"],
["Integration", "Works with existing tools", "Easy adoption"]
],
"border": { "pt": 1, "color": "CCCCCC" }
}
}
]
}
]
}deno run --allow-read --allow-write scripts/generate-scratch.ts spec.json output.pptxdeno run --allow-read --allow-write scripts/generate-scratch.ts spec.json output.pptxundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined| Script | Purpose | Permissions |
|---|---|---|
| Extract text inventory from PPTX | |
| Get slide info and extract previews | |
| Modify templates (replace/combine) | |
| Create PPTX from JSON specification | |
| 脚本 | 用途 | 权限 |
|---|---|---|
| 从PPTX中提取文本清单 | |
| 获取幻灯片信息并提取预览图 | |
| 修改模板(替换/组合) | |
| 从JSON规范创建PPTX | |
| Type | Description | Key Options |
|---|---|---|
| Text box | |
| Image from file or base64 | |
| Data table | |
| Geometric shapes | |
| Charts and graphs | |
| 类型 | 描述 | 关键选项 |
|---|---|---|
| 文本框 | |
| 来自文件或base64的图片 | |
| 数据表 | |
| 几何形状 | |
| 图表和图形 | |
{{PLACEHOLDER}}analyze-template.tsslideNumbers{{PLACEHOLDER}}analyze-template.tsslideNumbersslideSelectionsslideSelectionsTheme → Slide Master → Slide Layout → Slide主题 → 幻灯片母版 → 幻灯片版式 → 幻灯片{{placeholder}}<a:lstStyle/><a:lstStyle><p:ph type="..." idx="..."/>typeidx<a:buNone/>{{placeholder}}<a:lstStyle/><a:lstStyle><p:ph type="..." idx="..."/>typeidx<a:buNone/><a:lstStyle><a:rPr><!-- Layout: Color in lstStyle (GOOD - inheritable) -->
<p:txBody>
<a:lstStyle>
<a:lvl1pPr algn="ctr">
<a:buNone/> <!-- Suppress bullets -->
<a:defRPr sz="4400" b="1">
<a:solidFill><a:srgbClr val="FFFFFF"/></a:solidFill>
</a:defRPr>
</a:lvl1pPr>
</a:lstStyle>
<a:p>
<a:r><a:rPr lang="en-US"/><a:t>{{placeholder}}</a:t></a:r>
</a:p>
</p:txBody><a:lstStyle><a:rPr><!-- 版式:在lstStyle中定义颜色(推荐 - 可继承) -->
<p:txBody>
<a:lstStyle>
<a:lvl1pPr algn="ctr">
<a:buNone/> <!-- 抑制项目符号 -->
<a:defRPr sz="4400" b="1">
<a:solidFill><a:srgbClr val="FFFFFF"/></a:solidFill>
</a:defRPr>
</a:lvl1pPr>
</a:lstStyle>
<a:p>
<a:r><a:rPr lang="en-US"/><a:t>{{placeholder}}</a:t></a:r>
</a:p>
</p:txBody><!-- Slide: Empty lstStyle to inherit from layout -->
<p:sp>
<p:nvSpPr>
<p:cNvPr id="2" name="title 2"/>
<p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr>
<p:nvPr>
<p:ph type="ctrTitle"/> <!-- Links to layout placeholder -->
</p:nvPr>
</p:nvSpPr>
<p:spPr/> <!-- Empty = inherit position from layout -->
<p:txBody>
<a:bodyPr/>
<a:lstStyle/> <!-- Empty = inherit formatting from layout -->
<a:p>
<a:r>
<a:rPr lang="en-US"/> <!-- Empty = inherit character formatting -->
<a:t>{{placeholder}}</a:t> <!-- Content must be here -->
</a:r>
</a:p>
</p:txBody>
</p:sp><!-- 幻灯片:空lstStyle以从版式继承 -->
<p:sp>
<p:nvSpPr>
<p:cNvPr id="2" name="title 2"/>
<p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr>
<p:nvPr>
<p:ph type="ctrTitle"/> <!-- 链接到版式占位符 -->
</p:nvPr>
</p:nvSpPr>
<p:spPr/> <!-- 空值 = 从版式继承位置 -->
<p:txBody>
<a:bodyPr/>
<a:lstStyle/> <!-- 空值 = 从版式继承格式 -->
<a:p>
<a:r>
<a:rPr lang="en-US"/> <!-- 空值 = 继承字符格式 -->
<a:t>{{placeholder}}</a:t> <!-- 内容必须在此处 -->
</a:r>
</a:p>
</p:txBody>
</p:sp>| Issue | Cause | Solution |
|---|---|---|
| Text shows as black instead of white | Color defined in | Move color to layout's |
| Unwanted bullets appearing | Master's bodyStyle has bullets, layout doesn't override | Add |
| Placeholder text not appearing | Text only in layout, not in slide | Include text content in slide's |
| Formatting not applying | Slide has explicit formatting | Use empty |
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 文本显示为黑色而非白色 | 颜色定义在 | 将颜色移至版式 |
| 出现不需要的项目符号 | 母版的bodyStyle包含项目符号,版式未覆盖 | 在版式的 |
| 占位符文本未显示 | 文本仅存在于版式中,未在幻灯片中 | 在幻灯片的 |
| 格式未应用 | 幻灯片包含显式格式 | 使用空的 |
| Type | Usage |
|---|---|
| Centered title (title slides) |
| Standard title |
| Subtitle |
| Content area (use |
| Picture placeholder |
| Date/time |
| Footer |
| Slide number |
| 类型 | 用途 |
|---|---|
| 居中标题(标题幻灯片) |
| 标准标题 |
| 副标题 |
| 内容区域(多个时使用 |
| 图片占位符 |
| 日期/时间 |
| 页脚 |
| 幻灯片编号 |