slidev
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSlidev - Presentation Slides for Developers
Slidev - 面向开发者的演示幻灯片
Web-based slides maker built on Vite, Vue, and Markdown.
基于 Vite、Vue 和 Markdown 构建的 Web 幻灯片制作工具。
When to Use
适用场景
- Technical presentations or slidedecks with live code examples
- Syntax-highlighted code snippets with animations
- Interactive demos (Monaco editor, runnable code)
- Mathematical equations (LaTeX) or diagrams (Mermaid, PlantUML)
- Record presentations with presenter notes
- Export to PDF, PPTX, or host as SPA
- Code walkthroughs for developer talks or workshops
- 带有实时代码示例的技术演示或幻灯片
- 带动画的语法高亮代码片段
- 交互式演示(Monaco 编辑器、可运行代码)
- 数学公式(LaTeX)或图表(Mermaid、PlantUML)
- 使用演讲者备注录制演示
- 导出为 PDF、PPTX,或作为 SPA 托管
- 用于开发者演讲或工作坊的代码讲解
Quick Start
快速开始
bash
pnpm create slidev # Create project
pnpm run dev # Start dev server (opens http://localhost:3030)
pnpm run build # Build static SPA
pnpm run export # Export to PDF (requires playwright-chromium)Verify: After , confirm slides load at . After , check the output PDF exists in the project root.
pnpm run devhttp://localhost:3030pnpm run exportbash
pnpm create slidev # Create project
pnpm run dev # Start dev server (opens http://localhost:3030)
pnpm run build # Build static SPA
pnpm run export # Export to PDF (requires playwright-chromium)验证:运行 后,确认幻灯片已在 加载。运行 后,检查输出 PDF 是否存在于项目根目录。
pnpm run devhttp://localhost:3030pnpm run exportBasic Syntax
基本语法
md
---
theme: default
title: My Presentation
---md
---
theme: default
title: My Presentation
---First Slide
First Slide
Content here
Content here
Second Slide
Second Slide
More content
<!--
Presenter notes go here
-->
- `---` separates slides
- First frontmatter = headmatter (deck config)
- HTML comments = presenter notesMore content
<!--
Presenter notes go here
-->
- `---` 用于分隔幻灯片
- 第一个 frontmatter = headmatter(演示文稿配置)
- HTML 注释 = 演讲者备注Core References
核心参考
| Topic | Description | Reference |
|---|---|---|
| Markdown Syntax | Slide separators, frontmatter, notes, code blocks | core-syntax |
| Animations | v-click, v-clicks, motion, transitions | core-animations |
| Headmatter | Deck-wide configuration options | core-headmatter |
| Frontmatter | Per-slide configuration options | core-frontmatter |
| CLI Commands | Dev, build, export, theme commands | core-cli |
| Components | Built-in Vue components | core-components |
| Layouts | Built-in slide layouts | core-layouts |
| Exporting | PDF, PPTX, PNG export options | core-exporting |
| Hosting | Build and deploy to various platforms | core-hosting |
| Global Context | $nav, $slidev, composables API | core-global-context |
| 主题 | 描述 | 参考 |
|---|---|---|
| Markdown 语法 | 幻灯片分隔符、frontmatter、备注、代码块 | core-syntax |
| 动画 | v-click、v-clicks、motion、transitions | core-animations |
| Headmatter | 演示文稿级配置选项 | core-headmatter |
| Frontmatter | 单张幻灯片配置选项 | core-frontmatter |
| CLI 命令 | 开发、构建、导出、主题命令 | core-cli |
| 组件 | 内置 Vue 组件 | core-components |
| 布局 | 内置幻灯片布局 | core-layouts |
| 导出 | PDF、PPTX、PNG 导出选项 | core-exporting |
| 托管 | 构建并部署到各种平台 | core-hosting |
| 全局上下文 | $nav、$slidev、composables API | core-global-context |
Feature Reference
功能参考
Code & Editor
代码与编辑器
| Feature | Usage | Reference |
|---|---|---|
| Line highlighting | | code-line-highlighting |
| Click-based highlighting | | code-line-highlighting |
| Line numbers | | code-line-numbers |
| Scrollable code | | code-max-height |
| Code tabs | | code-groups |
| Monaco editor | | editor-monaco |
| Run code | | editor-monaco-run |
| Edit files | | editor-monaco-write |
| Code animations | | code-magic-move |
| TypeScript types | | code-twoslash |
| Import code | | code-import-snippet |
| 功能 | 用法 | 参考 |
|---|---|---|
| 行高亮 | | code-line-highlighting |
| 基于点击的高亮 | | code-line-highlighting |
| 行号 | | code-line-numbers |
| 可滚动代码 | | code-max-height |
| 代码标签页 | | code-groups |
| Monaco 编辑器 | | editor-monaco |
| 运行代码 | | editor-monaco-run |
| 编辑文件 | | editor-monaco-write |
| 代码动画 | | code-magic-move |
| TypeScript 类型 | | code-twoslash |
| 导入代码 | | code-import-snippet |
Diagrams & Math
图表与数学
| Feature | Usage | Reference |
|---|---|---|
| Mermaid diagrams | | diagram-mermaid |
| PlantUML diagrams | | diagram-plantuml |
| LaTeX math | | diagram-latex |
| 功能 | 用法 | 参考 |
|---|---|---|
| Mermaid 图表 | | diagram-mermaid |
| PlantUML 图表 | | diagram-plantuml |
| LaTeX 数学公式 | | diagram-latex |
Layout & Styling
布局与样式
| Feature | Usage | Reference |
|---|---|---|
| Canvas size | | layout-canvas-size |
| Zoom slide | | layout-zoom |
| Scale elements | | layout-transform |
| Layout slots | | layout-slots |
| Scoped CSS | | style-scoped |
| Global layers | | layout-global-layers |
| Draggable elements | | layout-draggable |
| Icons | | style-icons |
| 功能 | 用法 | 参考 |
|---|---|---|
| 画布尺寸 | | layout-canvas-size |
| 缩放幻灯片 | | layout-zoom |
| 缩放元素 | | layout-transform |
| 布局插槽 | | layout-slots |
| 作用域 CSS | 幻灯片中的 | style-scoped |
| 全局图层 | | layout-global-layers |
| 可拖拽元素 | | layout-draggable |
| 图标 | | style-icons |
Animation & Interaction
动画与交互
| Feature | Usage | Reference |
|---|---|---|
| Click animations | | core-animations |
| Rough markers | | animation-rough-marker |
| Drawing mode | Press | animation-drawing |
| Direction styles | | style-direction |
| Note highlighting | | animation-click-marker |
| 功能 | 用法 | 参考 |
|---|---|---|
| 点击动画 | | core-animations |
| Rough 标记 | | animation-rough-marker |
| 绘图模式 | 按 | animation-drawing |
| 方向样式 | | style-direction |
| 备注高亮 | 备注中的 | animation-click-marker |
Syntax Extensions
语法扩展
| Feature | Usage | Reference |
|---|---|---|
| Comark syntax | | syntax-comark |
| Block frontmatter | | syntax-block-frontmatter |
| Import slides | | syntax-importing-slides |
| Merge frontmatter | Main entry wins | syntax-frontmatter-merging |
| 功能 | 用法 | 参考 |
|---|---|---|
| Comark 语法 | | syntax-comark |
| 块级 frontmatter | | syntax-block-frontmatter |
| 导入幻灯片 | | syntax-importing-slides |
| 合并 frontmatter | 主入口优先 | syntax-frontmatter-merging |
Presenter & Recording
演讲者与录制
| Feature | Usage | Reference |
|---|---|---|
| Recording | Press | presenter-recording |
| Timer | | presenter-timer |
| Remote control | | presenter-remote |
| Ruby text | | presenter-notes-ruby |
| 功能 | 用法 | 参考 |
|---|---|---|
| 录制 | 按 | presenter-recording |
| 计时器 | | presenter-timer |
| 远程控制 | | presenter-remote |
| Ruby 文本 | | presenter-notes-ruby |
Export & Build
导出与构建
| Feature | Usage | Reference |
|---|---|---|
| Export options | | core-exporting |
| Build & deploy | | core-hosting |
| Build with PDF | | build-pdf |
| Cache images | Automatic for remote URLs | build-remote-assets |
| OG image | | build-og-image |
| SEO tags | | build-seo-meta |
Export prerequisite: is required for PDF/PPTX/PNG export. If export fails with a browser error, install this dependency first.
pnpm add -D playwright-chromium| 功能 | 用法 | 参考 |
|---|---|---|
| 导出选项 | | core-exporting |
| 构建与部署 | | core-hosting |
| 构建 PDF | | build-pdf |
| 缓存图片 | 远程 URL 自动缓存 | build-remote-assets |
| OG 图片 | | build-og-image |
| SEO 标签 | | build-seo-meta |
导出前置条件:PDF/PPTX/PNG 导出需要安装 。如果导出时出现浏览器错误,请先安装此依赖项。
pnpm add -D playwright-chromiumEditor & Tools
编辑器与工具
| Feature | Usage | Reference |
|---|---|---|
| Side editor | Click edit icon | editor-side |
| VS Code extension | Install | editor-vscode |
| Prettier | | editor-prettier |
| Eject theme | | tool-eject-theme |
| MCP server (AI agents) | | tool-mcp |
| 功能 | 用法 | 参考 |
|---|---|---|
| 侧边编辑器 | 点击编辑图标 | editor-side |
| VS Code 扩展 | 安装 | editor-vscode |
| Prettier | | editor-prettier |
| 提取主题 | | tool-eject-theme |
| MCP 服务器(AI Agent) | | tool-mcp |
Lifecycle & API
生命周期与 API
| Feature | Usage | Reference |
|---|---|---|
| Slide hooks | | api-slide-hooks |
| Navigation API | | core-global-context |
| 功能 | 用法 | 参考 |
|---|---|---|
| 幻灯片钩子 | | api-slide-hooks |
| 导航 API | | core-global-context |
Common Layouts
常用布局
| Layout | Purpose |
|---|---|
| Title/cover slide |
| Centered content |
| Standard slide |
| Two columns (use |
| Header + two columns |
| Image layouts |
| Embed URLs |
| Quotation |
| Section divider |
| Data/statement display |
| Intro/end slides |
| 布局 | 用途 |
|---|---|
| 标题/封面幻灯片 |
| 居中内容 |
| 标准幻灯片 |
| 双栏(使用 |
| 标题加双栏 |
| 图片布局 |
| 嵌入 URL |
| 引用 |
| 章节分隔页 |
| 数据/陈述展示 |
| 介绍/结束幻灯片 |
Resources
资源
- Documentation: https://sli.dev
- Theme Gallery: https://sli.dev/resources/theme-gallery
- Showcases: https://sli.dev/resources/showcases