presenterm
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesepresenterm - Terminal Slideshow Tool
presenterm - 终端幻灯片工具
presenterm is a modern terminal-based presentation tool that renders markdown files as slides. It supports themes, code syntax highlighting, images, diagram rendering (mermaid, d2), mathematical formulas (LaTeX, typst), and can export to PDF or HTML.
presenterm是一款现代终端演示工具,可将Markdown文件渲染为幻灯片。它支持主题切换、代码语法高亮、图片展示、图表渲染(mermaid、d2)、数学公式(LaTeX、typst),并可导出为PDF或HTML格式。
Core Principles
核心特性
- Markdown-first: Write presentations in familiar markdown syntax
- Terminal-native: Runs entirely in the terminal with rich rendering
- Advanced rendering: Render mermaid/d2 diagrams and LaTeX/typst formulas as images
- Presentation mode: Separate presentation view with speaker notes support
- Export capabilities: Generate PDF or HTML from markdown slides
- Code execution: Execute code snippets during presentations
- Theme support: Multiple built-in themes and custom theme support
- Markdown优先:使用熟悉的Markdown语法编写演示文稿
- 原生终端支持:完全在终端中运行,提供丰富的渲染效果
- 高级渲染:将mermaid/d2图表和LaTeX/typst公式渲染为图片
- 演示模式:独立的演示视图,支持演讲者备注
- 导出功能:将Markdown幻灯片生成PDF或HTML
- 代码执行:演示过程中执行代码片段
- 主题支持:多种内置主题及自定义主题支持
Installation
安装
bash
undefinedbash
undefinedmacOS (Homebrew)
macOS(Homebrew)
brew install presenterm
brew install presenterm
Cargo
Cargo
cargo install presenterm
cargo install presenterm
From source
从源码安装
git clone https://github.com/mfontanini/presenterm
cd presenterm
cargo install --path .
undefinedgit clone https://github.com/mfontanini/presenterm
cd presenterm
cargo install --path .
undefinedBasic Usage
基础用法
Running Presentations
运行演示文稿
bash
undefinedbash
undefinedRun a presentation
运行演示文稿
presenterm presentation.md
presenterm presentation.md
Use presentation mode (full-screen, controls hidden)
使用演示模式(全屏,隐藏控制栏)
presenterm -p presentation.md
presenterm --present presentation.md
presenterm -p presentation.md
presenterm --present presentation.md
Use specific theme
使用指定主题
presenterm -t dark presentation.md
presenterm --theme catppuccin presentation.md
presenterm -t dark presentation.md
presenterm --theme catppuccin presentation.md
List available themes
列出可用主题
presenterm --list-themes
presenterm --list-themes
Show current theme
查看当前主题
presenterm --current-theme
undefinedpresenterm --current-theme
undefinedExporting
导出
bash
undefinedbash
undefinedExport to PDF
导出为PDF
presenterm -e presentation.md
presenterm --export-pdf presentation.md
presenterm -e presentation.md
presenterm --export-pdf presentation.md
Export to PDF with specific output path
导出为PDF并指定输出路径
presenterm -e presentation.md -o output.pdf
presenterm --export-pdf presentation.md --output slides.pdf
presenterm -e presentation.md -o output.pdf
presenterm --export-pdf presentation.md --output slides.pdf
Export to HTML
导出为HTML
presenterm -E presentation.md
presenterm --export-html presentation.md -o presentation.html
presenterm -E presentation.md
presenterm --export-html presentation.md -o presentation.html
Specify temporary path for export
指定导出临时路径
presenterm -e presentation.md --export-temporary-path /tmp/presenterm
undefinedpresenterm -e presentation.md --export-temporary-path /tmp/presenterm
undefinedMarkdown Syntax
Markdown语法
Slide Separators
幻灯片分隔符
markdown
<!-- Slides are separated by --- -->markdown
<!-- 幻灯片使用 --- 分隔 -->First Slide
第一张幻灯片
Content here
内容在这里
Second Slide
第二张幻灯片
More content
更多内容
Third Slide
第三张幻灯片
Final slide
undefined最后一张幻灯片
undefinedSlide Layout
幻灯片布局
markdown
undefinedmarkdown
undefinedTitle Slide
标题幻灯片
Subtitle
副标题
Author Name
作者姓名
Content Slide
内容幻灯片
- Bullet point 1
- Bullet point 2
- Nested point
- Bullet point 3
- 项目符号1
- 项目符号2
- 嵌套项目
- 项目符号3
Code Slide
代码幻灯片
rust
fn main() {
println!("Hello, presenterm!");
}
``` (triple backtick)
---rust
fn main() {
println!("Hello, presenterm!");
}
```(三个反引号)
---Quote Slide
引用幻灯片
"The best way to predict the future is to invent it." — Alan Kay
undefined"预测未来的最好方式就是创造它。" — 艾伦·凯
undefinedSpeaker Notes
演讲者备注
markdown
undefinedmarkdown
undefinedMy Slide
我的幻灯片
Visible content
<!-- presenter notes
These notes are only visible in presentation mode
They won't appear on the slide itself
-->
More visible content
可见内容
<!-- presenter notes
这些备注仅在演示模式下可见
不会显示在幻灯片本身
-->
更多可见内容
Another Slide
另一张幻灯片
<!-- speaker notes
- Remember to mention X
- Don't forget Y
- Emphasize Z
-->
undefined<!-- speaker notes
- 记得提及X
- 不要忘记Y
- 强调Z
-->
undefinedImages
图片
markdown
undefinedmarkdown
undefinedImage Slide
图片幻灯片


Centered Image
居中图片

undefined
undefinedTables
表格
markdown
undefinedmarkdown
undefinedTable Example
表格示例
| Feature | Status | Priority |
|---|---|---|
| Export | Done | High |
| Themes | Done | High |
| Images | Done | Medium |
undefined| 功能 | 状态 | 优先级 |
|---|---|---|
| 导出 | 已完成 | 高 |
| 主题 | 已完成 | 高 |
| 图片 | 已完成 | 中 |
undefinedCode Highlighting
代码高亮
markdown
undefinedmarkdown
undefinedSyntax Highlighting
语法高亮
python
def fibonacci(n):
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)rust
fn factorial(n: u64) -> u64 {
(1..=n).product()
}javascript
const greet = (name) => {
console.log(`Hello, ${name}!`);
};undefinedpython
def fibonacci(n):
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)rust
fn factorial(n: u64) -> u64 {
(1..=n).product()
}javascript
const greet = (name) => {
console.log(`Hello, ${name}!`);
};undefinedCode Execution
代码执行
Executable Code Blocks
可执行代码块
bash
undefinedbash
undefinedEnable code snippet execution
启用代码片段执行
presenterm -x presentation.md
presenterm --enable-snippet-execution presentation.md
presenterm -x presentation.md
presenterm --enable-snippet-execution presentation.md
Enable auto-execution with replacement
启用自动执行并替换结果
presenterm -X presentation.md
presenterm --enable-snippet-execution-replace presentation.md
presenterm -X presentation.md
presenterm --enable-snippet-execution-replace presentation.md
Validate snippets without running
验证代码片段但不运行
presenterm --validate-snippets presentation.md
undefinedpresenterm --validate-snippets presentation.md
undefinedExecutable Code Syntax
可执行代码语法
markdown
undefinedmarkdown
undefinedLive Demo
实时演示
bash
echo "This will execute when you advance to this slide"
datebash
echo "切换到该幻灯片时会执行此命令"
dateAuto-Replace Demo
自动替换演示
bash
ls -laundefinedbash
ls -laundefinedAdvanced Rendering
高级渲染
presenterm supports rendering diagrams and formulas directly from code blocks, converting them to images during presentation load.
presenterm支持直接从代码块渲染图表和公式,在演示加载时将其转换为图片。
Mermaid Diagrams
Mermaid图表
Render mermaid diagrams using the attribute.
+renderRequirements:
- Install mermaid-cli:
npm install -g @mermaid-js/mermaid-cli
Syntax:
markdown
```mermaid +render
sequenceDiagram
Alice->>Bob: Hello Bob, how are you?
Bob-->>Alice: I'm good thanks!
Alice-)Bob: See you later!
```
```mermaid +render
graph TD
A[Start] --> B{Is it working?}
B -->|Yes| C[Great!]
B -->|No| D[Debug]
D --> B
```
```mermaid +render
pie title Project Time Distribution
"Development" : 40
"Testing" : 25
"Documentation" : 20
"Meetings" : 15
```Configuration (in config.yaml):
yaml
mermaid:
# Theme selection
theme: dark
# Background color
background: "#2E3440"
# Image scaling
scale: 2.0Size control with width attribute:
markdown
```mermaid +render +width:80%
graph LR
A --> B --> C
```Performance Note:
- Rendering takes ~2 seconds per diagram
- Rendered asynchronously (default 2 threads)
使用属性渲染Mermaid图表。
+render要求:
- 安装mermaid-cli:
npm install -g @mermaid-js/mermaid-cli
语法:
markdown
```mermaid +render
sequenceDiagram
Alice->>Bob: Hello Bob, how are you?
Bob-->>Alice: I'm good thanks!
Alice-)Bob: See you later!
```
```mermaid +render
graph TD
A[开始] --> B{是否正常工作?}
B -->|是| C[太好了!]
B -->|否| D[调试]
D --> B
```
```mermaid +render
pie title 项目时间分配
"开发" : 40
"测试" : 25
"文档" : 20
"会议" : 15
```配置(在config.yaml中):
yaml
mermaid:
# 主题选择
theme: dark
# 背景颜色
background: "#2E3440"
# 图片缩放
scale: 2.0使用width属性控制尺寸:
markdown
```mermaid +render +width:80%
graph LR
A --> B --> C
```性能说明:
- 每个图表渲染约需2秒
- 异步渲染(默认2线程)
d2 Diagrams
D2图表
Render d2 diagrams for architecture and system diagrams.
Requirements:
- Install d2: or download from releases
brew install d2
Syntax:
markdown
```d2 +renderSystem Architecture
系统架构
web_server: Web Server {
shape: rectangle
}
database: Database {
shape: cylinder
}
cache: Redis Cache {
shape: stored_data
}
web_server -> database: queries
web_server -> cache: reads/writes
```d2 +render
my_table: {
shape: sql_table
id: int {constraint: primary_key}
username: varchar(255)
email: varchar(255)
created_at: timestamp
}d2
direction: right
users -> api: HTTP requests
api -> auth: validate token
api -> database: query data
api -> cache: check cache
**Configuration (in config.yaml):**
```yaml
d2:
# Theme selection
theme: "Nord"
# Image scaling
scale: 1.5
```
**Size control:**
````markdown
```d2 +render +width:70%
A -> B -> C
```web_server: Web服务器 {
shape: rectangle
}
database: 数据库 {
shape: cylinder
}
cache: Redis缓存 {
shape: stored_data
}
web_server -> database: 查询
web_server -> cache: 读/写
```d2 +render
my_table: {
shape: sql_table
id: int {constraint: primary_key}
username: varchar(255)
email: varchar(255)
created_at: timestamp
}d2
direction: right
users -> api: HTTP请求
api -> auth: 验证令牌
api -> database: 查询数据
api -> cache: 检查缓存
**配置(在config.yaml中):**
```yaml
d2:
# 主题选择
theme: "Nord"
# 图片缩放
scale: 1.5
```
**尺寸控制:**
````markdown
```d2 +render +width:70%
A -> B -> C
```LaTeX Formulas
LaTeX公式
Render LaTeX mathematical formulas as images.
Requirements:
How it works:
- Pandoc converts LaTeX to typst
- Typst renders the formula to an image
Syntax:
markdown
```latex +render
\[ \sum_{n=1}^{\infty} 2^{-n} = 1 \]
```
```latex +render
\[
E = mc^2
\]
```
```latex +render
\[
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
\]
```
```latex +render
\[
\frac{d}{dx}\left( \int_{a}^{x} f(u)\,du\right) = f(x)
\]
```
```latex +render
\[
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
\]
```Configuration (in config.yaml):
yaml
undefined将LaTeX数学公式渲染为图片。
要求:
工作原理:
- Pandoc将LaTeX转换为Typst
- Typst将公式渲染为图片
语法:
markdown
```latex +render
\\[ \\sum_{n=1}^{\\infty} 2^{-n} = 1 \\]
```
```latex +render
\\[
E = mc^2
\\]
```
```latex +render
\\[
\\int_{-\\infty}^{\\infty} e^{-x^2} dx = \\sqrt{\\pi}
\\]
```
```latex +render
\\[
\\frac{d}{dx}\\left( \\int_{a}^{x} f(u)\\,du\\right) = f(x)
\\]
```
```latex +render
\\[
\\begin{bmatrix}
a & b \\\\
c & d
\\end{bmatrix}
\\]
```配置(在config.yaml中):
yaml
undefinedPixels per inch for formula rendering
公式渲染的像素密度
typst:
ppi: 300
**Size control:**
````markdown
```latex +render +width:60%
\[ \oint_C \mathbf{F} \cdot d\mathbf{r} = \iint_S (\nabla \times \mathbf{F}) \cdot d\mathbf{S} \]undefinedtypst:
ppi: 300
**尺寸控制:**
````markdown
```latex +render +width:60%
\\[ \\oint_C \\mathbf{F} \\cdot d\\mathbf{r} = \\iint_S (\
abla \\times \\mathbf{F}) \\cdot d\\mathbf{S} \\]undefinedTypst Formulas
Typst公式
Render typst formulas directly (bypassing LaTeX conversion).
Requirements:
- Install typst:
brew install typst
Syntax:
markdown
```typst +render
$ sum_(n=1)^oo 1/n^2 = pi^2/6 $
```
```typst +render
$ integral_(-oo)^oo e^(-x^2) d x = sqrt(pi) $
```
```typst +render
$ mat(
1, 2;
3, 4;
) $
```Benefits over LaTeX:
- Faster (no pandoc conversion step)
- Native typst syntax
- More modern formula typesetting
直接渲染Typst公式(跳过LaTeX转换步骤)。
要求:
- 安装typst:
brew install typst
语法:
markdown
```typst +render
$ sum_(n=1)^oo 1/n^2 = pi^2/6 $
```
```typst +render
$ integral_(-oo)^oo e^(-x^2) d x = sqrt(pi) $
```
```typst +render
$ mat(
1, 2;
3, 4;
) $
```相比LaTeX的优势:
- 速度更快(无需Pandoc转换步骤)
- 原生Typst语法
- 更现代的公式排版
Rendering Configuration
渲染配置
Global config.yaml settings:
yaml
undefined全局config.yaml设置:
yaml
undefinedFormula rendering
公式渲染
typst:
ppi: 300 # Pixels per inch for formulas
typst:
ppi: 300 # 公式的像素密度
Mermaid diagrams
Mermaid图表
mermaid:
theme: dark
background: "#2E3440"
scale: 2.0
mermaid:
theme: dark
background: "#2E3440"
scale: 2.0
d2 diagrams
D2图表
d2:
theme: "Nord"
scale: 1.5
undefinedd2:
theme: "Nord"
scale: 1.5
undefinedComplete Rendering Example
完整渲染示例
markdown
undefinedmarkdown
undefinedSystem Architecture
系统架构
d2
users: Users {
shape: person
}
lb: Load Balancer {
shape: rectangle
}
api: API Servers {
shape: rectangle
}
db: Database {
shape: cylinder
}
users -> lb
lb -> api: distribute
api -> db: queryd2
users: 用户 {
shape: person
}
lb: 负载均衡器 {
shape: rectangle
}
api: API服务器 {
shape: rectangle
}
db: 数据库 {
shape: cylinder
}
users -> lb
lb -> api: 分发
api -> db: 查询Request Flow
请求流程
mermaid
sequenceDiagram
participant U as User
participant A as API
participant D as Database
participant C as Cache
U->>A: Request data
A->>C: Check cache
alt Cache hit
C-->>A: Return cached data
else Cache miss
A->>D: Query database
D-->>A: Return data
A->>C: Update cache
end
A-->>U: Responsemermaid
sequenceDiagram
participant U as 用户
participant A as API
participant D as 数据库
participant C as 缓存
U->>A: 请求数据
A->>C: 检查缓存
alt 缓存命中
C-->>A: 返回缓存数据
else 缓存未命中
A->>D: 查询数据库
D-->>A: 返回数据
A->>C: 更新缓存
end
A-->>U: 响应Algorithm Complexity
算法复杂度
latex
\[
T(n) = \begin{cases}
O(1) & \text{best case} \\
O(\log n) & \text{average case} \\
O(n) & \text{worst case}
\end{cases}
\]latex
\\[
T(n) = \\begin{cases}
O(1) & \\text{最佳情况} \\\\
O(\\log n) & \\text{平均情况} \\\\
O(n) & \\text{最坏情况}
\\end{cases}
\\]Mathematical Formula
数学公式
typst
$ P(A|B) = (P(B|A) dot P(A)) / P(B) $undefinedtypst
$ P(A|B) = (P(B|A) dot P(A)) / P(B) $undefinedImage Protocols
图片协议
bash
undefinedbash
undefinedAuto-detect best protocol
自动检测最佳协议
presenterm --image-protocol auto presentation.md
presenterm --image-protocol auto presentation.md
Use iTerm2 protocol
使用iTerm2协议
presenterm --image-protocol iterm2 presentation.md
presenterm --image-protocol iterm2 presentation.md
Use kitty protocol (local mode)
使用kitty协议(本地模式)
presenterm --image-protocol kitty-local presentation.md
presenterm --image-protocol kitty-local presentation.md
Use kitty protocol (remote mode)
使用kitty协议(远程模式)
presenterm --image-protocol kitty-remote presentation.md
presenterm --image-protocol kitty-remote presentation.md
Use sixel protocol
使用sixel协议
presenterm --image-protocol sixel presentation.md
presenterm --image-protocol sixel presentation.md
Use ASCII blocks (fallback)
使用ASCII块(降级方案)
presenterm --image-protocol ascii-blocks presentation.md
undefinedpresenterm --image-protocol ascii-blocks presentation.md
undefinedThemes
主题
Built-in Themes
内置主题
bash
undefinedbash
undefinedList all available themes
列出所有可用主题
presenterm --list-themes
presenterm --list-themes
Common themes:
常用主题:
presenterm -t dark presentation.md
presenterm -t light presentation.md
presenterm -t catppuccin presentation.md
presenterm -t dracula presentation.md
presenterm -t gruvbox presentation.md
presenterm -t monokai presentation.md
presenterm -t nord presentation.md
presenterm -t solarized-dark presentation.md
presenterm -t solarized-light presentation.md
undefinedpresenterm -t dark presentation.md
presenterm -t light presentation.md
presenterm -t catppuccin presentation.md
presenterm -t dracula presentation.md
presenterm -t gruvbox presentation.md
presenterm -t monokai presentation.md
presenterm -t nord presentation.md
presenterm -t solarized-dark presentation.md
presenterm -t solarized-light presentation.md
undefinedCustom Themes
自定义主题
bash
undefinedbash
undefinedUse custom theme from config
使用配置文件中的自定义主题
presenterm -c ~/.config/presenterm/config.yaml presentation.md
presenterm --config-file custom-config.yaml presentation.md
undefinedpresenterm -c ~/.config/presenterm/config.yaml presentation.md
presenterm --config-file custom-config.yaml presentation.md
undefinedSpeaker Notes Mode
演讲者备注模式
Publishing Speaker Notes
发布演讲者备注
bash
undefinedbash
undefinedPublish speaker notes to local network
将演讲者备注发布到本地网络
presenterm -P presentation.md
presenterm --publish-speaker-notes presentation.md
presenterm -P presentation.md
presenterm --publish-speaker-notes presentation.md
Listen for speaker notes (presenter's view)
监听演讲者备注(演示者视图)
presenterm -l
presenterm --listen-speaker-notes
This allows you to:
- Run presentation on one screen
- View speaker notes on another device/screen
- Perfect for dual-monitor setupspresenterm -l
presenterm --listen-speaker-notes
这允许你:
- 在一个屏幕上运行演示
- 在另一个设备/屏幕上查看演讲者备注
- 非常适合双显示器设置Validation
验证
bash
undefinedbash
undefinedValidate that slides don't overflow terminal
验证幻灯片是否超出终端显示范围
presenterm --validate-overflows presentation.md
presenterm --validate-overflows presentation.md
Validate code snippets
验证代码片段
presenterm --validate-snippets presentation.md
presenterm --validate-snippets presentation.md
Combine validations
组合验证
presenterm --validate-overflows --validate-snippets presentation.md
undefinedpresenterm --validate-overflows --validate-snippets presentation.md
undefinedKeyboard Controls
键盘控制
During Presentation
演示过程中
Navigation:
←/→ Previous/Next slide
Space/Enter Next slide
Backspace Previous slide
Home First slide
End Last slide
g Go to specific slide (enter number)
Display:
f Toggle fullscreen
q/Esc Quit presentation
Code Execution:
e Execute code block (with -x flag)
Help:
? Show help/controls导航:
←/→ 上一张/下一张幻灯片
Space/Enter 下一张幻灯片
Backspace 上一张幻灯片
Home 第一张幻灯片
End 最后一张幻灯片
g 跳转到指定幻灯片(输入编号)
显示:
f 切换全屏
q/Esc 退出演示
代码执行:
e 执行代码块(需使用-x参数)
帮助:
? 显示帮助/控制说明Configuration
配置
Config File Location
配置文件位置
bash
undefinedbash
undefinedDefault config locations:
默认配置文件位置:
- Linux: ~/.config/presenterm/config.yaml
- Linux: ~/.config/presenterm/config.yaml
- macOS: ~/Library/Application Support/presenterm/config.yaml
- macOS: ~/Library/Application Support/presenterm/config.yaml
- Windows: %APPDATA%\presenterm\config.yaml
- Windows: %APPDATA%\presenterm\config.yaml
Specify custom config
指定自定义配置文件
presenterm -c /path/to/config.yaml presentation.md
undefinedpresenterm -c /path/to/config.yaml presentation.md
undefinedExample Configuration
示例配置
yaml
undefinedyaml
undefinedconfig.yaml
config.yaml
theme: catppuccin
image_protocol: auto
theme: catppuccin
image_protocol: auto
Default options
默认选项
presentation_mode: true
validate_overflows: true
presentation_mode: true
validate_overflows: true
Code execution
代码执行
enable_snippet_execution: false
undefinedenable_snippet_execution: false
undefinedCommon Workflows
常见工作流
Workflow 1: Create Simple Presentation
工作流1:创建简单演示文稿
bash
undefinedbash
undefined1. Create markdown file
1. 创建Markdown文件
cat > demo.md << 'EOF'
cat > demo.md << 'EOF'
Welcome
欢迎
A presenterm demo
presenterm演示
Key Features
核心特性
- Terminal-based
- Markdown syntax
- Multiple themes
- Export to PDF/HTML
- 终端原生
- Markdown语法
- 多种主题
- 导出为PDF/HTML
Thank You!
谢谢!
Questions?
EOF
有问题吗?
EOF
2. Run presentation
2. 运行演示
presenterm -p demo.md
presenterm -p demo.md
3. Export to PDF
3. 导出为PDF
presenterm -e demo.md -o demo.pdf
undefinedpresenterm -e demo.md -o demo.pdf
undefinedWorkflow 2: Technical Presentation with Code
工作流2:带代码的技术演示
bash
undefinedbash
undefined1. Create presentation with code examples
1. 创建包含代码示例的演示文稿
cat > tech-talk.md << 'EOF'
cat > tech-talk.md << 'EOF'
Technical Deep Dive
技术深度解析
Rust Async Programming
Rust异步编程
Basic Example
基础示例
rust
async fn fetch_data() -> Result<String, Error> {
let response = reqwest::get("https://api.example.com")
.await?;
response.text().await
}rust
async fn fetch_data() -> Result<String, Error> {
let response = reqwest::get("https://api.example.com")
.await?;
response.text().await
}Live Demo
实时演示
bash
cargo --version
rustc --versionbash
cargo --version
rustc --versionQuestions?
有问题吗?
EOF
EOF
2. Present with code execution enabled
2. 启用代码执行功能进行演示
presenterm -x -p tech-talk.md
presenterm -x -p tech-talk.md
3. Validate before sharing
3. 分享前验证
presenterm --validate-overflows --validate-snippets tech-talk.md
presenterm --validate-overflows --validate-snippets tech-talk.md
4. Export for distribution
4. 导出用于分发
presenterm -e tech-talk.md -o tech-talk.pdf
undefinedpresenterm -e tech-talk.md -o tech-talk.pdf
undefinedWorkflow 3: Dual-Screen Presentation
工作流3:双屏幕演示
bash
undefinedbash
undefinedTerminal 1 (presenter view with notes)
终端1(带备注的演示者视图)
presenterm -P presentation.md
presenterm -P presentation.md
Terminal 2 (or another device - audience view)
终端2(或其他设备 - 观众视图)
presenterm -l
presenterm -l
This shows:
效果:
- Terminal 1: Full presentation with speaker notes visible
- 终端1:显示完整演示及演讲者备注
- Terminal 2: Synchronized view following presenter
- 终端2:同步跟随演示者的视图
undefinedundefinedWorkflow 4: Themed Corporate Presentation
工作流4:企业主题演示
bash
undefinedbash
undefined1. Create config with company theme
1. 创建包含公司主题的配置文件
mkdir -p ~/.config/presenterm
cat > ~/.config/presenterm/config.yaml << 'EOF'
theme: solarized-light
presentation_mode: true
validate_overflows: true
EOF
mkdir -p ~/.config/presenterm
cat > ~/.config/presenterm/config.yaml << 'EOF'
theme: solarized-light
presentation_mode: true
validate_overflows: true
EOF
2. Create presentation
2. 创建演示文稿
vim quarterly-review.md
vim quarterly-review.md
3. Preview with theme
3. 使用主题预览
presenterm quarterly-review.md
presenterm quarterly-review.md
4. Export with theme applied
4. 应用主题导出
presenterm -e quarterly-review.md -o quarterly-review.pdf
presenterm -e quarterly-review.md -o quarterly-review.pdf
5. Also export HTML version
5. 同时导出HTML版本
presenterm -E quarterly-review.md -o quarterly-review.html
undefinedpresenterm -E quarterly-review.md -o quarterly-review.html
undefinedWorkflow 5: Conference Talk
工作流5:会议演讲
markdown
undefinedmarkdown
undefinedConference Talk Template
会议演讲模板
About Me
关于我

- Name
- Title
- Company
- Twitter: @handle

- 姓名
- 职位
- 公司
- Twitter: @handle
Agenda
议程
- Problem Statement
- Our Approach
- Demo
- Results
- Q&A
- 问题陈述
- 我们的方案
- 演示
- 结果
- 问答
Problem Statement
问题陈述
The Challenge
挑战
- Point 1
- Point 2
- Point 3
- 要点1
- 要点2
- 要点3
Live Demo
实时演示
bash
./demo.shbash
./demo.shResults
结果
| Metric | Before | After | Improvement |
|---|---|---|---|
| Speed | 100ms | 10ms | 10x |
| Memory | 500MB | 50MB | 10x |
| 指标 | 之前 | 之后 | 提升 |
|---|---|---|---|
| 速度 | 100ms | 10ms | 10倍 |
| 内存 | 500MB | 50MB | 10倍 |
Thank You!
谢谢!
Questions?
有问题吗?
Slides: https://example.com/slides
Code: https://github.com/user/repo
undefinedundefinedBest Practices
最佳实践
Slide Design
幻灯片设计
- One idea per slide: Keep slides focused
- Minimal text: Use bullets, not paragraphs
- Visual hierarchy: Use headings effectively
- Code readability: Keep code snippets short and readable
- Consistent formatting: Use same style throughout
- 每张幻灯片一个核心观点:保持幻灯片聚焦
- 文字极简:使用项目符号,而非段落
- 视觉层次:有效使用标题
- 代码可读性:代码片段保持简短易读
- 格式一致:全程使用相同风格
File Organization
文件组织
presentation/
├── slides.md # Main presentation
├── images/ # Image assets
│ ├── logo.png
│ ├── diagram1.png
│ └── screenshot.png
├── code/ # Code examples
│ ├── example1.rs
│ └── demo.py
└── export/ # Exported versions
├── slides.pdf
└── slides.htmlpresentation/
├── slides.md # 主演示文稿
├── images/ # 图片资源
│ ├── logo.png
│ ├── diagram1.png
│ └── screenshot.png
├── code/ # 代码示例
│ ├── example1.rs
│ └── demo.py
└── export/ # 导出版本
├── slides.pdf
└── slides.htmlSpeaker Notes
演讲者备注
markdown
undefinedmarkdown
undefinedSlide Title
幻灯片标题
Visible content
<!-- presenter notes
Time checkpoint: 5 minutes
Key talking points:
- Emphasize security aspect
- Mention customer feedback
- Transition to demo
Reminder: drink water!
-->
undefined可见内容
<!-- presenter notes
时间节点:5分钟
核心演讲要点:
- 强调安全方面
- 提及客户反馈
- 过渡到演示
提醒:喝水!
-->
undefinedCode Examples
代码示例
- Syntax highlighting: Always specify language
- Keep it short: 10-15 lines max per slide
- Highlight key parts: Use comments to draw attention
- Test code: Ensure examples are correct
- Use exec sparingly: Only for impactful demos
- 语法高亮:始终指定语言
- 保持简短:每张幻灯片最多10-15行
- 高亮关键部分:使用注释吸引注意力
- 测试代码:确保示例正确
- 谨慎使用exec:仅用于有冲击力的演示
Validation Before Presenting
演示前验证
bash
undefinedbash
undefinedFull validation checklist
完整验证清单
presenterm --validate-overflows presentation.md
presenterm --validate-snippets presentation.md
presenterm -p presentation.md # Dry run
presenterm -e presentation.md # Generate backup PDF
undefinedpresenterm --validate-overflows presentation.md
presenterm --validate-snippets presentation.md
presenterm -p presentation.md # 预演
presenterm -e presentation.md # 生成备份PDF
undefinedTips and Tricks
技巧和窍门
Quick Presentation Template
快速演示模板
bash
undefinedbash
undefinedCreate new presentation from template
从模板创建新演示文稿
cat > new-talk.md << 'EOF'
cat > new-talk.md << 'EOF'
Talk Title
演讲标题
Subtitle
副标题
Your Name
你的姓名
Outline
大纲
- Introduction
- Main Content
- Conclusion
- 介绍
- 主要内容
- 结论
Section 1
第一部分
Content here
内容在这里
Thank You
谢谢
Questions?
EOF
undefined有问题吗?
EOF
undefinedRapid Iteration
快速迭代
bash
undefinedbash
undefinedUse watch for live reload during development
使用watch实现开发时实时重载
(requires 'entr' or 'watchexec')
(需要'install entr'或'watchexec')
With entr
使用entr
echo presentation.md | entr presenterm /_
echo presentation.md | entr presenterm /_
With watchexec
使用watchexec
watchexec -w presentation.md presenterm presentation.md
undefinedwatchexec -w presentation.md presenterm presentation.md
undefinedExport All Formats
导出所有格式
bash
#!/bin/bashbash
#!/bin/bashexport-all.sh - Export presentation to all formats
export-all.sh - 将演示文稿导出为所有格式
PRESENTATION="$1"
BASENAME="${PRESENTATION%.md}"
echo "Exporting $PRESENTATION..."
PRESENTATION="$1"
BASENAME="${PRESENTATION%.md}"
echo "正在导出 $PRESENTATION..."
presenterm -e "$PRESENTATION" -o "${BASENAME}.pdf"
echo "✓ PDF exported"
presenterm -e "$PRESENTATION" -o "${BASENAME}.pdf"
echo "✓ PDF导出完成"
HTML
HTML
presenterm -E "$PRESENTATION" -o "${BASENAME}.html"
echo "✓ HTML exported"
echo "All exports complete!"
undefinedpresenterm -E "$PRESENTATION" -o "${BASENAME}.html"
echo "✓ HTML导出完成"
echo "所有导出完成!"
undefinedPresentation Checklist
演示检查清单
markdown
undefinedmarkdown
undefinedPre-Presentation Checklist
演示前检查清单
Technical:
- Run validation:
presenterm --validate-overflows slides.md - Test code execution blocks
- Verify images load correctly
- Check font size visibility
- Test on actual presentation screen
- Export backup PDF
Content:
- Timing (practice run-through)
- Speaker notes complete
- Transitions smooth
- No typos
- Links working
Setup:
- Terminal font size readable
- Theme appropriate for venue
- Backup presentation on USB
- Power adapter
- HDMI/adapter cable
undefined技术方面:
- 运行验证:
presenterm --validate-overflows slides.md - 测试代码执行块
- 验证图片加载正常
- 检查字体大小可见性
- 在实际演示屏幕上测试
- 导出备份PDF
内容方面:
- 计时(预演一遍)
- 演讲者备注完整
- 过渡流畅
- 无拼写错误
- 链接可用
设置方面:
- 终端字体大小可读
- 主题适合场地
- U盘备份演示文稿
- 电源适配器
- HDMI/转换线
undefinedTroubleshooting
故障排除
Images Not Displaying
图片无法显示
bash
undefinedbash
undefinedTry different image protocols
尝试不同的图片协议
presenterm --image-protocol iterm2 presentation.md
presenterm --image-protocol kitty-local presentation.md
presenterm --image-protocol ascii-blocks presentation.md # Fallback
presenterm --image-protocol iterm2 presentation.md
presenterm --image-protocol kitty-local presentation.md
presenterm --image-protocol ascii-blocks presentation.md # 降级方案
Check image paths are relative or absolute
检查图片路径是相对还是绝对路径
Ensure images exist
确保图片存在
ls -la images/
undefinedls -la images/
undefinedSlides Overflow Terminal
幻灯片超出终端显示范围
bash
undefinedbash
undefinedValidate first
先验证
presenterm --validate-overflows presentation.md
presenterm --validate-overflows presentation.md
Solutions:
解决方案:
1. Reduce content per slide
1. 减少单张幻灯片内容
2. Increase terminal size
2. 增大终端尺寸
3. Use smaller font
3. 使用更小的字体
4. Break into multiple slides
4. 拆分为多张幻灯片
undefinedundefinedCode Execution Not Working
代码执行不工作
bash
undefinedbash
undefinedEnsure execution is enabled
确保已启用执行功能
presenterm -x presentation.md
presenterm -x presentation.md
Check script permissions
检查脚本权限
chmod +x script.sh
chmod +x script.sh
Test code block independently first
先独立测试代码块
undefinedundefinedTheme Not Applied
主题未应用
bash
undefinedbash
undefinedList available themes
列出可用主题
presenterm --list-themes
presenterm --list-themes
Check current theme
检查当前主题
presenterm --current-theme
presenterm --current-theme
Specify theme explicitly
显式指定主题
presenterm -t dark presentation.md
presenterm -t dark presentation.md
Check config file location
检查配置文件位置
ls -la ~/.config/presenterm/config.yaml
undefinedls -la ~/.config/presenterm/config.yaml
undefinedIntegration with Other Tools
与其他工具集成
With Git
与Git集成
bash
undefinedbash
undefinedTrack presentations in version control
使用版本控制跟踪演示文稿
git init
git add presentation.md images/
git commit -m "feat: add initial presentation"
git init
git add presentation.md images/
git commit -m "feat: 添加初始演示文稿"
Create tagged releases for different versions
为不同版本创建标签
git tag -a v1.0 -m "Conference version"
undefinedgit tag -a v1.0 -m "会议版本"
undefinedWith make/just
与make/just集成
just
undefinedjust
undefinedjustfile
justfile
present:
presenterm -p slides.md
export:
presenterm -e slides.md -o output.pdf
presenterm -E slides.md -o output.html
validate:
presenterm --validate-overflows slides.md
presenterm --validate-snippets slides.md
all: validate export
undefinedpresent:
presenterm -p slides.md
export:
presenterm -e slides.md -o output.pdf
presenterm -E slides.md -o output.html
validate:
presenterm --validate-overflows slides.md
presenterm --validate-snippets slides.md
all: validate export
undefinedWith Continuous Integration
与持续集成集成
yaml
undefinedyaml
undefined.github/workflows/validate-presentation.yml
.github/workflows/validate-presentation.yml
name: Validate Presentation
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install presenterm
run: cargo install presenterm
- name: Validate slides
run: |
presenterm --validate-overflows presentation.md
presenterm --validate-snippets presentation.md
- name: Export PDF
run: presenterm -e presentation.md -o presentation.pdf
- name: Upload PDF
uses: actions/upload-artifact@v2
with:
name: presentation
path: presentation.pdf
undefinedname: 验证演示文稿
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 安装presenterm
run: cargo install presenterm
- name: 验证幻灯片
run: |
presenterm --validate-overflows presentation.md
presenterm --validate-snippets presentation.md
- name: 导出PDF
run: presenterm -e presentation.md -o presentation.pdf
- name: 上传PDF
uses: actions/upload-artifact@v2
with:
name: presentation
path: presentation.pdf
undefinedQuick Reference
快速参考
bash
undefinedbash
undefinedBasic usage
基础用法
presenterm slides.md # View presentation
presenterm -p slides.md # Presentation mode
presenterm -t dark slides.md # With theme
presenterm slides.md # 查看演示文稿
presenterm -p slides.md # 演示模式
presenterm -t dark slides.md # 使用主题
Export
导出
presenterm -e slides.md # Export to PDF
presenterm -E slides.md # Export to HTML
presenterm -e slides.md -o out.pdf # Custom output path
presenterm -e slides.md # 导出PDF
presenterm -E slides.md # 导出HTML
presenterm -e slides.md -o out.pdf # 自定义输出路径
Validation
验证
presenterm --validate-overflows slides.md
presenterm --validate-snippets slides.md
presenterm --validate-overflows slides.md
presenterm --validate-snippets slides.md
Code execution
代码执行
presenterm -x slides.md # Enable execution
presenterm -X slides.md # Auto-replace execution
presenterm -x slides.md # 启用执行
presenterm -X slides.md # 自动替换执行
Themes
主题
presenterm --list-themes # List themes
presenterm --current-theme # Show current theme
presenterm --list-themes # 列出主题
presenterm --current-theme # 查看当前主题
Speaker notes
演讲者备注
presenterm -P slides.md # Publish notes
presenterm -l # Listen for notes
presenterm -P slides.md # 发布备注
presenterm -l # 监听备注
Help
帮助
presenterm --help # Full help
presenterm --acknowledgements # Show acknowledgements
presenterm -V # Version
undefinedpresenterm --help # 完整帮助
presenterm --acknowledgements # 显示致谢
presenterm -V # 版本
undefinedMarkdown Quick Reference
Markdown快速参考
markdown
undefinedmarkdown
undefinedSlide separator
幻灯片分隔符
Headings
标题
H1
H1
H2
H2
H3
H3
Lists
列表
- Bullet point
- Nested bullet
- Numbered item
- 项目符号
- 嵌套项目
- 编号项目
Code blocks
代码块
language
code here
``` (triple backtick)language
代码内容
```(三个反引号)Images
图片


Tables
表格
| Col1 | Col2 |
|---|---|
| A | B |
| 列1 | 列2 |
|---|---|
| A | B |
Quotes
引用
Quote text
引用文本
Speaker notes
演讲者备注
<!-- presenter notes
Notes here
-->
<!-- presenter notes
备注内容
-->
Executable code
可执行代码
bash
command
``` (triple backtick)bash
命令
```(三个反引号)Rendered diagrams
渲染图表
mermaid
graph TD
A --> B
``` (triple backtick)
```d2 +render
A -> B
``` (triple backtick)mermaid
graph TD
A --> B
```(三个反引号)
```d2 +render
A -> B
```(三个反引号)Rendered formulas
渲染公式
latex
\[ E = mc^2 \]
``` (triple backtick)
```typst +render
$ sum_(i=1)^n i = (n(n+1))/2 $
``` (triple backtick)latex
\\[ E = mc^2 \\]
```(三个反引号)
```typst +render
$ sum_(i=1)^n i = (n(n+1))/2 $
```(三个反引号)Resources
资源
- Official repository: https://github.com/mfontanini/presenterm
- Documentation: https://github.com/mfontanini/presenterm/wiki
- Issue tracker: https://github.com/mfontanini/presenterm/issues
- Installation: or
brew install presentermcargo install presenterm
- 官方仓库: https://github.com/mfontanini/presenterm
- 文档: https://github.com/mfontanini/presenterm/wiki
- 问题跟踪: https://github.com/mfontanini/presenterm/issues
- 安装: 或
brew install presentermcargo install presenterm
Summary
总结
Primary directives:
- Write presentations in markdown
- Use presentation mode () for actual presentations
-p - Use advanced rendering: mermaid/d2 for diagrams, LaTeX/typst for formulas
- Include speaker notes for complex slides
- Validate before presenting
- Export to PDF/HTML for distribution
- Choose appropriate theme for venue/audience
- Keep slides simple and focused
- Test code execution and rendering blocks before presenting
Most common commands:
- - Present
presenterm -p slides.md - - Export PDF
presenterm -e slides.md - - Use theme
presenterm -t theme slides.md - - Validate
presenterm --validate-overflows slides.md - - See themes
presenterm --list-themes
Advanced rendering:
- Mermaid diagrams: (requires mermaid-cli)
```mermaid +render - d2 diagrams: (requires d2)
```d2 +render - LaTeX formulas: (requires typst + pandoc)
```latex +render - Typst formulas: (requires typst)
```typst +render
核心要点:
- 使用Markdown编写演示文稿
- 实际演示时使用演示模式()
-p - 使用高级渲染:Mermaid/D2制作图表,LaTeX/Typst制作公式
- 复杂幻灯片添加演讲者备注
- 演示前进行验证
- 导出为PDF/HTML用于分发
- 根据场地/观众选择合适主题
- 保持幻灯片简洁聚焦
- 演示前测试代码执行和渲染块
最常用命令:
- - 开始演示
presenterm -p slides.md - - 导出PDF
presenterm -e slides.md - - 使用指定主题
presenterm -t theme slides.md - - 验证幻灯片范围
presenterm --validate-overflows slides.md - - 查看可用主题
presenterm --list-themes
高级渲染:
- Mermaid图表: (需要mermaid-cli)
```mermaid +render - D2图表: (需要d2)
```d2 +render - LaTeX公式: (需要typst + pandoc)
```latex +render - Typst公式: (需要typst) ",
```typst +render