Slidev PPT Generator
Generate slides.md using the standard Slidev workflow, then preview, build, and export within an existing or new Slidev project.
When to Use
- - User explicitly mentions INLINECODE1
- User wants
slides.md, Markdown slides, or a locally previewable presentation - User wants to turn a Markdown outline into a previewable or exportable Slidev presentation
- User wants to export
PDF, PPTX, or build static HTML
When NOT to Use
- - User wants an editable native PPTX and does not accept image-based Slidev PPTX export
- User wants a Jobs-style, minimalist tech-feel, 9:16 vertical, single-HTML presentation
- User only needs a single HTML landing page or long-form article, not the Slidev workflow
- User has no local Node/npm environment, and the current task does not allow installing dependencies
Directory Structure
- -
scripts/generate.js — Generate a basic slides.md from a given topic - INLINECODE7 — Export
pdf / pptx / png from within a Slidev project directory - INLINECODE11 — Tech-share template reference
- INLINECODE12 — Example slides
- INLINECODE13 — Presentation design and layout rules; must be consulted when generating a formal deck
Standard Workflow
1. Confirm Output Target
Confirm the following information first. If the user has not provided everything, fill in the minimum necessary defaults:
- 1. Topic
- Style:
tech / product / INLINECODE16 - Page count range
- Language:
auto / zh / INLINECODE19 - Final deliverable: preview, HTML, PDF, PPTX
- Tone:
formal / executive / technical / INLINECODE23 - Official theme preference: auto-detect, or user-specified
default / seriph / INLINECODE26
If the user just says "make a PPT", use these defaults:
- - Style:
tech, Pages: 10, Language: INLINECODE29 - Output: Generate
slides.md first, then ask whether to export - Tone:
formal, Theme: auto-detect
Language rules:
- - If the user explicitly requests English, the entire deck should be in English
- If the user explicitly requests Chinese, the entire deck should be in Chinese
- If the user does not specify, default to the primary language of the user's current message
- Keep titles, body text in the same language; avoid mixing languages
- Do not generate bilingual pages unless the user explicitly requests it
2. Check or Initialize Slidev Project
Prefer reusing an existing Slidev project. If the user does not specify a directory, default to ~/slidev-ppt.
CODEBLOCK0
If it does not exist, initialize:
CODEBLOCK1
If the user needs PDF/PPTX export, initialize with export dependencies:
CODEBLOCK2
The init script installs these official themes: @slidev/theme-default, @slidev/theme-seriph, @slidev/theme-apple-basic, @slidev/theme-bricks, @slidev/theme-shibainu.
3. Generate slides.md — The Core Step
Do NOT just produce a bullet-point outline. You are writing a complete, visually designed presentation. Before writing any slide, decide:
- 1. Visual direction — Pick a color mood and image style (dark tech, clean white, warm earth tones)
- Theme — Select based on tone (see Theme Selection below)
- Background images — Select 3-5 Unsplash images that match the topic (see Visual Recipes below)
- Layout variety — Plan which layouts to use; never use
default for every page
Then write the complete slides.md directly. The generate.js script only produces a bare skeleton; for any real presentation you should write the file yourself with proper frontmatter, backgrounds, layouts, and styled content.
If the user provides an existing outline, read the existing slides.md first, then modify on top of it.
4. Preview
CODEBLOCK3
5. Export
CODEBLOCK4
Or directly: INLINECODE42
Visual Design Recipes
This is the most important section. A deck without visual design is just a document. Follow these recipes.
Cover Page
The cover page MUST have a background image. Use layout: cover with a background field. The theme automatically applies a dark overlay for text readability.
CODEBLOCK5
How to Choose Background Images
Use Unsplash direct URLs. Pick images by topic keyword:
- - Tech/AI: server rooms, circuit boards, abstract networks, code on screen
- Business: modern offices, skylines, handshakes, conference rooms
- Nature/Growth: forests, mountains, sunrise, green fields
- Data/Analytics: dashboards, charts, abstract data visualization
URL format: INLINECODE45
Find image IDs at unsplash.com. Use specific photo IDs, not the old source.unsplash.com API (deprecated). Pick 3-5 images per deck and reuse them for visual consistency.
For slides that need a background but not a photo, use CSS gradients:
CODEBLOCK6
Or solid colors:
CODEBLOCK7
Section Dividers
Use layout: section or layout: cover with a background for chapter transitions. Never leave a section page as plain white text.
CODEBLOCK8
Content Pages with Visual Structure
Two-column with image (apple-basic theme):
CODEBLOCK9
Fact/statistic highlight:
CODEBLOCK10
Quote page:
CODEBLOCK11
Statement page (big idea, minimal text):
CODEBLOCK12
Card Grids with UnoCSS
For feature lists, comparisons, or multi-item layouts, use HTML grid with UnoCSS classes instead of plain bullet lists:
CODEBLOCK13
For dark themes, use bg-white/10 or bg-gray-800 instead of bg-gray-100.
Architecture / Flow Diagrams
Mermaid diagrams may have rendering issues in PDF/PPTX export (timing-dependent). Keep Mermaid to under ~15 nodes. For complex diagrams or maximum reliability, use card grids instead:
- - Use ASCII-style text diagrams in code blocks
- Use a card-grid layout to represent components
- Use a visual flow with arrows (→) in styled HTML
Example component architecture without Mermaid:
CODEBLOCK14
Closing Page
The closing page should have a background (same as cover or complementary). Never end with plain white.
CODEBLOCK15
Theme Selection
Prefer official themes. Recommended mapping:
- -
technical → default (dark code-friendly, good for tech shares) - INLINECODE54 →
seriph (elegant serif fonts, good for business) - INLINECODE56 →
seriph (same, emphasize conclusions) - INLINECODE58 →
apple-basic (clean, image-heavy layouts)
Global Frontmatter Template
Always include these fields in the first slide's frontmatter:
CODEBLOCK16
- -
colorSchema: use light for most business/formal decks; dark only for technical/code-heavy decks - INLINECODE63 unless the deck is specifically about code
- Always set a
background on the first slide
Design Requirements
- - Every cover and section page MUST have a background (image, gradient, or color). No plain white covers.
- At least 3 slides should use a non-default layout (cover, section, fact, quote, statement, image-right, two-cols)
- At least 2 slides should have background images from Unsplash
- One page, one main conclusion. Prefer a compact 8-14 page deck
- The cover page must include title, subtitle, and author/date
- Include at least 1 architecture/structure page, 1 scenario page, 1 value page
- Avoid consecutive bullet-list-only pages; alternate with visual layouts (fact, quote, image-right, card grid)
- Copy should be specific — use real nouns, platform names, module names
- Prefer Markdown tables over HTML tables
- If HTML tables are necessary, always include
<thead> and INLINECODE66 - For comparisons, prefer card grids or two-column layouts over dense tables
Before generating a formal presentation, you must read references/presentation-design.md.
PDF/PPTX Export Caveats
When the user needs PDF or PPTX output:
- - Mermaid diagrams: work but may have timing issues with complex diagrams (>15 nodes). Keep them simple or use card grids.
- Click animations: each
v-click step becomes a separate PDF page. Use --per-slide flag to get one page per slide: INLINECODE69 - External images must be accessible at export time — use full Unsplash URLs with INLINECODE70
- PPTX is image-based — each slide is a screenshot, not editable PowerPoint. Warn the user.
- Test with PDF first before exporting PPTX — PDF is more reliable
- INLINECODE71 will auto-install
playwright-chromium if missing
Style Parameters
Determined by the current task, not hard-coded:
- -
formal — Restrained, stable structure, minimal decoration. Use seriph theme, light color scheme, 1-2 Unsplash backgrounds. - INLINECODE75 — Emphasizes conclusions, comparisons, action items. Use
seriph, light, fact/statement layouts for key numbers. - INLINECODE77 — Higher information density, code blocks OK. Use
default theme, dark color scheme, more code examples. - INLINECODE79 — Stronger visual impact, more background images. Use
apple-basic, light, image-heavy layouts (image-right, intro-image, 3-images).
Default: formal. Switch based on user's explicit request.
Language Parameter
- -
auto — Follow the primary language of the user's current message - INLINECODE83 — Chinese deck
- INLINECODE84 — English deck
Do not force English if user does not specify.
Post-Generation Checklist
After completing slides.md, verify:
- 1. Does the cover page have a background image?
- Are there at least 2-3 non-default layouts used?
- Are there any plain-white section divider pages? (Fix: add gradient or image background)
- Are there more than 3 consecutive bullet-list pages? (Fix: insert a fact, quote, or image-right page)
- If targeting PDF export: are there any Mermaid diagrams? (Fix: replace with card grids)
- Does the closing page have a background?
- Does any single page have more than 6 main blocks?
- Is there overflow risk on the last page, architecture page, or two-column pages?
Common Errors
Slidev Not Found
Run npx slidev --version in the project directory. If it fails, run node scripts/init-project.js --dir ~/slidev-ppt.
Export Failure
Check: (1) current directory is a Slidev project, (2) playwright-chromium is installed, (3) slides.md can start in preview mode.
Ugly Output
If the exported deck looks like a plain text document: you forgot backgrounds, used only default layout, and didn't apply visual recipes. Go back to the Visual Design Recipes section and redo the slides.
Expected Behavior After Triggering
When the user says "help me make a PPT about X":
- 1. Confirm topic, style, page count, output target
- Check/initialize Slidev project
- Write a complete, visually designed
slides.md with backgrounds, varied layouts, and styled content — NOT a bullet-point outline - Provide preview method
- When the user requests export, execute export
Do not just return a list of commands; actually write the slides.md file.
Slidev PPT 生成器
使用标准 Slidev 工作流程生成 slides.md,然后在现有或新的 Slidev 项目中预览、构建和导出。
使用场景
- - 用户明确提及 Slidev
- 用户需要 slides.md、Markdown 幻灯片或可本地预览的演示文稿
- 用户希望将 Markdown 大纲转换为可预览或可导出的 Slidev 演示文稿
- 用户希望导出 PDF、PPTX 或构建静态 HTML
不使用场景
- - 用户需要可编辑的原生 PPTX,且不接受基于图像的 Slidev PPTX 导出
- 用户需要乔布斯风格、极简科技感、9:16 竖屏、单 HTML 演示文稿
- 用户只需要单个 HTML 落地页或长文文章,不需要 Slidev 工作流程
- 用户没有本地 Node/npm 环境,且当前任务不允许安装依赖
目录结构
- - scripts/generate.js — 根据给定主题生成基础 slides.md
- scripts/export.js — 在 Slidev 项目目录内导出 pdf / pptx / png
- templates/tech-share.md — 技术分享模板参考
- examples/demo-slides.md — 示例幻灯片
- references/presentation-design.md — 演示文稿设计与布局规则;生成正式演示文稿时必须查阅
标准工作流程
1. 确认输出目标
首先确认以下信息。如果用户未提供全部信息,则填写必要的最小默认值:
- 1. 主题
- 风格:tech / product / report
- 页数范围
- 语言:auto / zh / en
- 最终交付物:预览、HTML、PDF、PPTX
- 语气:formal / executive / technical / launch
- 官方主题偏好:自动检测,或用户指定的 default / seriph / apple-basic
如果用户只说做个PPT,使用以下默认值:
- - 风格:tech,页数:10,语言:auto
- 输出:先生成 slides.md,然后询问是否导出
- 语气:formal,主题:自动检测
语言规则:
- - 如果用户明确要求英文,整个演示文稿应为英文
- 如果用户明确要求中文,整个演示文稿应为中文
- 如果用户未指定,默认使用用户当前消息的主要语言
- 保持标题和正文使用同一种语言;避免混用语言
- 除非用户明确要求,否则不生成双语页面
2. 检查或初始化 Slidev 项目
优先复用现有 Slidev 项目。如果用户未指定目录,默认使用 ~/slidev-ppt。
bash
ls ~/slidev-ppt/package.json ~/slidev-ppt/slides.md
如果不存在,则初始化:
bash
node scripts/init-project.js --dir ~/slidev-ppt
如果用户需要 PDF/PPTX 导出,使用导出依赖初始化:
bash
node scripts/init-project.js --dir ~/slidev-ppt --with-export-deps
初始化脚本会安装以下官方主题:@slidev/theme-default、@slidev/theme-seriph、@slidev/theme-apple-basic、@slidev/theme-bricks、@slidev/theme-shibainu。
3. 生成 slides.md — 核心步骤
不要只生成要点大纲。 你要编写的是一个完整的、经过视觉设计的演示文稿。在编写任何幻灯片之前,先确定:
- 1. 视觉方向 — 选择色彩氛围和图片风格(深色科技、简洁白色、温暖大地色系)
- 主题 — 根据语气选择(参见下方主题选择)
- 背景图片 — 选择 3-5 张与主题匹配的 Unsplash 图片(参见下方视觉配方)
- 布局多样性 — 规划要使用的布局;不要每页都使用 default
然后直接编写完整的 slides.md。generate.js 脚本只生成基础骨架;对于任何真实的演示文稿,你应该自己编写文件,包含正确的前置元数据、背景、布局和样式化内容。
如果用户提供了现有大纲,先读取现有的 slides.md,然后在此基础上修改。
4. 预览
bash
npx slidev slides.md
5. 导出
bash
node /path/to/slidev-ppt-generator/scripts/export.js --format pdf --output presentation.pdf
或直接:npx slidev export --format pdf --output presentation.pdf
视觉设计配方
这是最重要的部分。 没有视觉设计的演示文稿只是一份文档。请遵循以下配方。
封面页
封面页必须有背景图片。使用 layout: cover 并添加 background 字段。主题会自动应用深色叠加层以确保文字可读性。
markdown
theme: seriph
background: https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=1920
class: text-center
构建 AI 代理的未来
自主、本地优先、始终可用
作者姓名 — 2026年3月
如何选择背景图片
使用 Unsplash 直接 URL。根据主题关键词选择图片:
- - 科技/AI:服务器机房、电路板、抽象网络、屏幕上的代码
- 商业:现代办公室、天际线、握手、会议室
- 自然/成长:森林、山脉、日出、绿色田野
- 数据/分析:仪表盘、图表、抽象数据可视化
URL 格式:https://images.unsplash.com/photo-{ID}?auto=format&fit=crop&w=1920&q=80
在 unsplash.com 查找图片 ID。使用特定的照片 ID,不要使用旧的 source.unsplash.com API(已弃用)。每个演示文稿选择 3-5 张图片并重复使用以保持视觉一致性。
对于需要背景但不需要照片的幻灯片,使用 CSS 渐变:
markdown
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)
class: text-center text-white
或纯色:
markdown
background: #1a1a2e
class: text-white
章节分隔页
使用 layout: section 或带背景的 layout: cover 作为章节过渡。永远不要让章节页面保持纯白色文字。
markdown
layout: section
background: linear-gradient(135deg, #0c3547 0%, #1a6b8a 100%)
class: text-white
架构深度解析
带视觉结构的内容页面
带图片的双栏布局(apple-basic 主题):
markdown
layout: image-right
image: https://images.unsplash.com/photo-xxx?w=960
为什么本地优先很重要
- - 你的数据永远不会离开你的机器
- 完全控制配置
- 设置后即可离线工作
- 无需重复服务费用
事实/统计数据突出显示:
markdown
layout: fact
7 个代理
在单个网关上同时运行
5 个渠道
WhatsApp、Telegram、Discord、飞书、钉钉
引用页面:
markdown
layout: quote
最好的 AI 助手是你能完全掌控的那个。
— 本地优先设计理念
声明页面(大想法,极简文字):
markdown
layout: statement
自托管意味着自我主权
使用 UnoCSS 的卡片网格
对于功能列表、对比或多项目布局,使用带有 UnoCSS 类的 HTML 网格,而不是纯项目符号列表:
markdown
关键能力
多渠道
同时支持 WhatsApp、Telegram、Discord
标签
skill
ai