create-marp-deck

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Create Marp Slide Deck

创建Marp幻灯片演示文稿

Create a presentation slide deck using the Marp markdown format, following the established conventions below.
使用Marp Markdown格式创建演示文稿幻灯片,遵循以下既定规范。

Phase 1: Interview

阶段1:访谈

Before generating anything, interview the user by asking these questions one at a time, waiting for each answer before proceeding to the next.
Question 1 — Goal & Topic: Ask: "What's this presentation about? What should the audience walk away knowing or being able to do?"
Question 2 — Audience: Ask: "Who's the audience? (e.g., engineering team, executives, external clients, conference attendees)"
Question 3 — Key Points: Ask: "What are the key points or sections you want to cover? List the main ideas, even if rough."
  • If the user provides files, URLs, or references, read/fetch them thoroughly before continuing.
Question 4 — Data & Demos: Ask: "Any specific data, code examples, diagrams, or demos to include? Do you have these ready, or should I create them?"
Question 5 — Constraints: Ask: "Any constraints? Think: target number of slides, time limit for the talk, things to avoid, or specific branding requirements."
After collecting all answers, briefly summarize what you understood and ask for confirmation before proceeding.
在生成任何内容之前,通过以下问题逐一询问用户,等待每个问题的答复后再继续下一个。
问题1 — 目标与主题: 询问:“这份演示文稿的主题是什么?受众看完后应该了解或能够做到什么?”
问题2 — 受众: 询问:“受众是谁?(例如:工程团队、管理层、外部客户、会议参与者)”
问题3 — 核心要点: 询问:“你想要涵盖哪些核心要点或章节?列出主要内容即可,无需完善。”
  • 如果用户提供文件、URL或参考资料,需先完整阅读/获取这些内容后再继续。
问题4 — 数据与演示素材: 询问:“是否需要包含特定的数据、代码示例、图表或演示素材?你已经准备好这些内容,还是需要我来创建?”
问题5 — 约束条件: 询问:“是否有任何约束条件?比如:目标幻灯片数量、演讲时间限制、需要规避的内容,或特定的品牌要求。”
收集所有答复后,简要总结你的理解并请用户确认,然后再继续下一步。

Phase 2: Generate the Deck

阶段2:生成演示文稿

Follow the structure and conventions below exactly.

严格遵循以下结构和规范。

FRONTMATTER

FRONTMATTER

Every deck starts with this exact frontmatter:
yaml
---
marp: true
theme: default
paginate: true
size: 16:9
---

每个演示文稿都必须以以下内容作为前置配置:
yaml
---
marp: true
theme: default
paginate: true
size: 16:9
---

CSS STYLE BLOCK

CSS样式块

Immediately after the frontmatter, include a
<style>
block with:
  1. Base font sizes for section, table, blockquote, pre
  2. Header styles for breadcrumb navigation (gray text, blue for active section)
  3. Section classes for the title slide and each part/section divider - these get gradient backgrounds and white text
紧随前置配置之后,添加一个
<style>
块,包含:
  1. 基础字体大小:针对章节、表格、块引用、代码块
  2. 面包屑导航头部样式:灰色文本,当前章节为蓝色
  3. 章节类:针对标题幻灯片和每个部分/章节分隔符 - 这些将使用渐变背景和白色文本

Color palette for section dividers (pick 2-4 based on number of parts):

章节分隔符调色板(根据部分数量选择2-4种):

  • Blue:
    linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%)
  • Green:
    linear-gradient(135deg, #064e3b 0%, #047857 100%)
  • Amber:
    linear-gradient(135deg, #7a4a1a 0%, #a66b2e 100%)
  • Purple:
    linear-gradient(135deg, #3d1e5c 0%, #5a2d8e 100%)
  • Title slide (always dark navy):
    linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%)
  • 蓝色:
    linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%)
  • 绿色:
    linear-gradient(135deg, #064e3b 0%, #047857 100%)
  • 琥珀色:
    linear-gradient(135deg, #7a4a1a 0%, #a66b2e 100%)
  • 紫色:
    linear-gradient(135deg, #3d1e5c 0%, #5a2d8e 100%)
  • 标题幻灯片(固定为深海军蓝):
    linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%)

Template:

模板:

html
<style>
section {
  font-size: 22px;
}
table {
  font-size: 18px;
}
blockquote {
  font-size: 22px;
}
pre {
  font-size: 16px;
}
header {
  font-size: 14px;
  color: #999;
}
header strong {
  color: #2563eb;
}
section.title-slide {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}
section.part-FIRST,
section.part-SECOND,
section.part-THIRD,
section.title-slide {
  --h1-color: #fff;
  --heading-strong-color: #fff;
  --fgColor-default: rgba(255, 255, 255, 0.95);
  --fgColor-muted: rgba(255, 255, 255, 0.7);
  color: white;
}
section.part-FIRST {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
}
section.part-SECOND {
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
}
section.part-THIRD {
  background: linear-gradient(135deg, #3d1e5c 0%, #5a2d8e 100%);
}
</style>
Replace
FIRST
,
SECOND
,
THIRD
with short descriptive names for each part (e.g.,
part-context
,
part-results
,
part-summary
).

html
<style>
section {
  font-size: 22px;
}
table {
  font-size: 18px;
}
blockquote {
  font-size: 22px;
}
pre {
  font-size: 16px;
}
header {
  font-size: 14px;
  color: #999;
}
header strong {
  color: #2563eb;
}
section.title-slide {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}
section.part-FIRST,
section.part-SECOND,
section.part-THIRD,
section.title-slide {
  --h1-color: #fff;
  --heading-strong-color: #fff;
  --fgColor-default: rgba(255, 255, 255, 0.95);
  --fgColor-muted: rgba(255, 255, 255, 0.7);
  color: white;
}
section.part-FIRST {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
}
section.part-SECOND {
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
}
section.part-THIRD {
  background: linear-gradient(135deg, #3d1e5c 0%, #5a2d8e 100%);
}
</style>
FIRST
SECOND
THIRD
替换为每个部分的简短描述性名称(例如:
part-context
part-results
part-summary
)。

SLIDE STRUCTURE

幻灯片结构

The deck follows this exact order:
演示文稿严格遵循以下顺序:

1. Title Slide

1. 标题幻灯片

markdown
<!-- _class: lead title-slide -->
markdown
<!-- _class: lead title-slide -->

Main Title

主标题

Subtitle

副标题

Key detail 1: value Key detail 2: value Date: Month Year
undefined
关键细节1:值 关键细节2:值 日期:年 月
undefined

2. Questions / Goals slide

2. 问题/目标幻灯片

List 3-5 questions the deck will answer, as a numbered list with bold lead-ins.
列出3-5个演示文稿将解答的问题,使用带粗体引导词的编号列表。

3. Agenda slide

3. 议程幻灯片

markdown
<!-- _class: lead title-slide -->
markdown
<!-- _class: lead title-slide -->

Agenda

议程

Part 1: Name

第一部分:名称

Short description
简短描述

Part 2: Name

第二部分:名称

Short description
简短描述

Part 3: Name

第三部分:名称

Short description
undefined
简短描述
undefined

4. For each part: section divider + content slides

4. 每个部分:章节分隔符 + 内容幻灯片

Section divider (full-bleed colored background):
markdown
<!-- _header: "" -->
<!-- _class: lead part-NAME -->
章节分隔符(全屏彩色背景):
markdown
<!-- _header: "" -->
<!-- _class: lead part-NAME -->

Part N: Section title

第N部分:章节标题

One-line description

**Content slides** (with breadcrumb header):
```markdown
<!-- header: "**Active section** > Other section > Other section" -->
一行描述

**内容幻灯片**(带面包屑导航头部):
```markdown
<!-- header: "**当前章节** > 其他章节 > 其他章节" -->

Slide title

幻灯片标题

Content here

The breadcrumb shows where you are in the deck. The active section is wrapped in `**bold**`. The header directive persists until changed, so you only need to set it once per section (on the first content slide after the divider). Reset it with `<!-- _header: "" -->` before each section divider.
内容此处

面包屑导航显示当前在演示文稿中的位置。当前章节用`**粗体**`包裹。头部指令会持续生效,因此每个章节只需在分隔符后的第一张内容幻灯片上设置一次。在每个章节分隔符前,使用`<!-- _header: "" -->`重置头部。

5. Final Slides

5. 最终幻灯片

End with summary/takeaway slides, still within the last section.

以总结/要点幻灯片结束,仍属于最后一个章节。

FORMATTING RULES

格式规则

  1. Sentence case for all headings — only capitalize the first letter and proper nouns (e.g., "Get started in 5 minutes", not "Get Started in 5 Minutes"). Breadcrumb headers follow the same rule
  2. No trailing periods on bullets, text lines, or table cells
  3. Single dash (
    -
    ) for parenthetical separators, not double dash (
    --
    )
  4. Backticks for program names, file names, and technical identifiers (not bold)
  5. Bold for emphasis on key phrases and findings
  6. Tables for data comparisons - keep them concise
  7. Blockquotes (
    >
    ) for key callouts or distinctions
  8. One idea per slide - if a slide is getting dense, split it into two
  9. Keep bullet lists to 3-5 items max per slide
  10. No parenthetical notes in the slide body unless absolutely necessary

  1. 所有标题采用句首大写格式 — 仅首字母和专有名词大写(例如:“5分钟快速上手”,而非每个实词大写)。面包屑导航头部遵循相同规则
  2. 项目符号、文本行或表格单元格末尾无句号
  3. 使用单破折号 (
    -
    ) 作为括号分隔符,而非双破折号 (
    --
    )
  4. 使用反引号 标记程序名称、文件名和技术标识符(而非粗体)
  5. 使用粗体 强调关键短语和结论
  6. 使用表格 进行数据比较 - 保持简洁
  7. 使用块引用 (
    >
    ) 标记关键提示或区别
  8. 每张幻灯片一个核心观点 - 如果幻灯片内容过于密集,拆分为两张
  9. 每张幻灯片的项目符号列表最多3-5项
  10. 幻灯片正文中除非绝对必要,否则不使用括号注释

EXPORTING

导出操作

After writing the deck, export to both HTML and PPTX:
bash
npx @marp-team/marp-cli@latest --no-stdin FILENAME.md -o FILENAME.html
npx @marp-team/marp-cli@latest --no-stdin --pptx FILENAME.md -o FILENAME.pptx
Always use
--no-stdin
to prevent marp from hanging on stdin.

编写完演示文稿后,导出为HTML和PPTX两种格式:
bash
npx @marp-team/marp-cli@latest --no-stdin FILENAME.md -o FILENAME.html
npx @marp-team/marp-cli@latest --no-stdin --pptx FILENAME.md -o FILENAME.pptx
务必使用
--no-stdin
参数,以防止marp在标准输入处挂起。

EDITABLE PPTX EXPORT (OPTIONAL)

可编辑PPTX导出(可选)

If the user asks for editable PPTX (text that can be edited in PowerPoint or Google Slides), run these additional steps. This requires LibreOffice and python-pptx to be installed.
bash
undefined
如果用户要求可编辑的PPTX(可在PowerPoint或Google Slides中编辑文本),请执行以下额外步骤。这需要安装LibreOffice和python-pptx。
bash
undefined

PPTX - editable text (experimental, requires LibreOffice)

PPTX - 可编辑文本(实验性,需安装LibreOffice)

npx @marp-team/marp-cli@latest --no-stdin --pptx --pptx-editable --allow-local-files FILENAME.md -o FILENAME-editable.pptx python3 -c " from pptx import Presentation from pptx.util import Emu prs = Presentation('FILENAME-editable.pptx') margin = Emu(747720) for slide in prs.slides: for shape in slide.shapes: if shape.has_text_frame and shape.shape_type == 17: tf = shape.text_frame if not tf.text.strip() or tf.text.strip().isdigit(): continue font_size = None if tf.paragraphs and tf.paragraphs[0].runs: font_size = tf.paragraphs[0].runs[0].font.size if not font_size: continue new_width = prs.slide_width - margin - shape.left if new_width > shape.width: shape.width = new_width min_height = int(font_size * 1.4) * 2 if shape.height < min_height: shape.height = min_height tf.word_wrap = True prs.save('FILENAME-editable.pptx') "

Notes:
- `--allow-local-files` needed for local images
- `--pptx-editable` requires LibreOffice installed
- The python-pptx post-processing fixes text box sizing issues from LibreOffice conversion
- Always use `--no-stdin` to prevent marp from hanging on stdin
npx @marp-team/marp-cli@latest --no-stdin --pptx --pptx-editable --allow-local-files FILENAME.md -o FILENAME-editable.pptx python3 -c " from pptx import Presentation from pptx.util import Emu prs = Presentation('FILENAME-editable.pptx') margin = Emu(747720) for slide in prs.slides: for shape in slide.shapes: if shape.has_text_frame and shape.shape_type == 17: tf = shape.text_frame if not tf.text.strip() or tf.text.strip().isdigit(): continue font_size = None if tf.paragraphs and tf.paragraphs[0].runs: font_size = tf.paragraphs[0].runs[0].font.size if not font_size: continue new_width = prs.slide_width - margin - shape.left if new_width > shape.width: shape.width = new_width min_height = int(font_size * 1.4) * 2 if shape.height < min_height: shape.height = min_height tf.word_wrap = True prs.save('FILENAME-editable.pptx') "

注意事项:
- 本地图片需要`--allow-local-files`参数
- `--pptx-editable`需要安装LibreOffice
- python-pptx后处理用于修复LibreOffice转换中的文本框大小问题
- 务必使用`--no-stdin`参数,以防止marp在标准输入处挂起