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 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
- 包含实时代码示例的技术演示文稿
- 带语法高亮和动画效果的代码片段
- 交互式演示(Monaco编辑器、可运行代码)
- 数学公式(LaTeX)或图表(Mermaid、PlantUML)
- 带演讲者备注的演示录制
- 导出为PDF、PPTX格式,或作为SPA部署
Quick Start
快速开始
bash
pnpm create slidev # Create project
pnpm run dev # Start dev server
pnpm run export # Export to PDFbash
pnpm create slidev # Create project
pnpm run dev # Start dev server
pnpm run export # Export to PDFBasic 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语法 | 幻灯片分隔符、全局配置、备注、代码块 | core-syntax |
| 动画效果 | v-click、v-clicks、动态效果、过渡动画 | core-animations |
| 全局配置 | 演示文稿级别的配置选项 | core-headmatter |
| 单页配置 | 单张幻灯片的配置选项 | core-frontmatter |
| CLI命令 | 开发、构建、导出、主题相关命令 | core-cli |
| 内置组件 | 内置Vue组件 | core-components |
| 内置布局 | 内置幻灯片布局 | core-layouts |
| 导出功能 | PDF、PPTX、PNG导出选项 | core-exporting |
| 部署托管 | 构建并部署至各类平台 | core-hosting |
| 全局上下文 | $nav、$slidev、组合式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 |
| 手绘标记 | | animation-rough-marker |
| 绘图模式 | 按下 | animation-drawing |
| 方向样式 | | style-direction |
| 备注高亮 | 备注中的 | animation-click-marker |
Syntax Extensions
语法扩展
| Feature | Usage | Reference |
|---|---|---|
| MDC syntax | | syntax-mdc |
| Block frontmatter | | syntax-block-frontmatter |
| Import slides | | syntax-importing-slides |
| Merge frontmatter | Main entry wins | syntax-frontmatter-merging |
| 功能 | 使用方式 | 参考链接 |
|---|---|---|
| MDC语法 | | syntax-mdc |
| 块级全局配置 | 使用 | syntax-block-frontmatter |
| 导入幻灯片 | | syntax-importing-slides |
| 配置合并规则 | 主入口文件配置优先级更高 | 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 |
| 注音文本 | | 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 |
| 功能 | 使用方式 | 参考链接 |
|---|---|---|
| 导出选项 | | core-exporting |
| 构建与部署 | | core-hosting |
| 带PDF的构建 | | build-pdf |
| 图片缓存 | 自动缓存远程URL图片 | build-remote-assets |
| OG图片 | | build-og-image |
| SEO标签 | | build-seo-meta |
Editor & 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 |
| 功能 | 使用方式 | 参考链接 |
|---|---|---|
| 侧边编辑器 | 点击编辑图标 | editor-side |
| VS Code扩展 | 安装 | editor-vscode |
| Prettier插件 | | editor-prettier |
| 导出主题 | | tool-eject-theme |
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