slides-generator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseslides-generator
幻灯片生成器
Create Hummingbot-branded presentation slides in PDF format from markdown content. Features two-column layouts and Mermaid diagram rendering for technical architecture and flowcharts.
从Markdown内容生成带有Hummingbot品牌风格的PDF格式演示幻灯片,支持双栏布局以及用于技术架构和流程图的Mermaid图表渲染。
Workflow
工作流程
Step 1: Get Markdown Content
步骤1:获取Markdown内容
Ask the user to provide a markdown file or paste markdown content. The content should follow this format:
markdown
undefined请用户提供Markdown文件或粘贴Markdown内容,内容需遵循以下格式:
markdown
undefinedPresentation Title
Presentation Title
1. First Slide Title
1. First Slide Title
Content for the first slide. Can include:
- Bullet points
- Bold text and italic text
- Code blocks
Content for the first slide. Can include:
- Bullet points
- Bold text and italic text
- Code blocks
2. Second Slide Title
2. Second Slide Title
More content here.
More content here.
3. Third Slide Title
3. Third Slide Title
And so on...
**Format Rules:**
- `# Title` = Presentation title (optional, becomes title slide)
- `## N. Slide Title` = New slide (N is slide number)
- Content under each `##` heading becomes slide content
- Supports markdown formatting: lists, bold, italic, code blocks, linksAnd so on...
**格式规则:**
- `# 标题` = 演示文稿标题(可选,将作为标题幻灯片)
- `## N. 幻灯片标题` = 新建幻灯片(N为幻灯片编号)
- 每个`##`标题下的内容即为该幻灯片的内容
- 支持Markdown格式:列表、粗体、斜体、代码块、链接Step 2: Parse and Confirm
步骤2:解析并确认
Before generating the PDF, parse the markdown and show the user a summary:
📊 Slide Outline:
1. First Slide Title
2. Second Slide Title
3. Third Slide Title
...
Total: X slides
Please confirm to proceed with PDF generation, or provide edits.Wait for user confirmation before proceeding.
生成PDF前,先解析Markdown内容并向用户展示摘要:
📊 幻灯片大纲:
1. First Slide Title
2. Second Slide Title
3. Third Slide Title
...
总计:X张幻灯片
请确认是否继续生成PDF,或提供修改意见。等待用户确认后再继续操作。
Step 3: Generate PDF
步骤3:生成PDF
Run the generation script:
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/slides-generator/scripts/generate_slides.sh) \
--input "<markdown_file_or_content>" \
--output "<output_pdf_path>"Or if the user provided inline content, save it to a temp file first:
bash
undefined运行生成脚本:
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/slides-generator/scripts/generate_slides.sh) \
--input "<markdown_file_or_content>" \
--output "<output_pdf_path>"若用户提供的是内嵌内容,先将其保存至临时文件:
bash
undefinedSave content to temp file
Save content to temp file
cat > /tmp/slides_content.md << 'SLIDES_EOF'
<markdown_content_here>
SLIDES_EOF
cat > /tmp/slides_content.md << 'SLIDES_EOF'
<markdown_content_here>
SLIDES_EOF
Generate PDF
Generate PDF
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/slides-generator/scripts/generate_slides.sh)
--input /tmp/slides_content.md
--output ~/slides_output.pdf
--input /tmp/slides_content.md
--output ~/slides_output.pdf
undefinedbash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/slides-generator/scripts/generate_slides.sh)
--input /tmp/slides_content.md
--output ~/slides_output.pdf
--input /tmp/slides_content.md
--output ~/slides_output.pdf
undefinedStep 4: Deliver Result
步骤4:交付结果
After generation, tell the user:
- The PDF file location
- How many slides were generated
- Offer to open/view the PDF if desired
生成完成后,告知用户:
- PDF文件的位置
- 生成的幻灯片数量
- 若用户需要,可提供打开/查看PDF的选项
Editing Existing Slides
编辑现有幻灯片
If the user wants to edit slides from a previously generated PDF:
- Read the original markdown (if available) or view the PDF to understand current content
- Ask the user what changes they want:
- Edit specific slide content
- Add new slides
- Remove slides
- Reorder slides
- Apply changes to the markdown
- Regenerate the PDF
Use the flag to update specific slides without regenerating all:
--editbash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/slides-generator/scripts/generate_slides.sh) \
--input "<updated_markdown>" \
--output "<same_pdf_path>" \
--edit若用户想要编辑已生成PDF对应的幻灯片:
- 读取原始Markdown(若可用)或查看PDF以了解当前内容
- 询问用户需要的修改:
- 编辑特定幻灯片内容
- 添加新幻灯片
- 删除幻灯片
- 调整幻灯片顺序
- 对Markdown内容应用修改
- 重新生成PDF
使用标记可更新特定幻灯片,无需重新生成全部:
--editbash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/slides-generator/scripts/generate_slides.sh) \
--input "<updated_markdown>" \
--output "<same_pdf_path>" \
--editDiagrams
图表
Users can describe diagrams in natural language using syntax. You must translate these descriptions to Mermaid code before generating the PDF.
mermaid:用户可使用语法以自然语言描述图表。生成PDF前,你必须将这些描述转换为Mermaid代码。
mermaid:User Input Format
用户输入格式
Users write descriptions like:
markdown
mermaid: A flowchart showing User Interface connecting to Condor and MCP Agents,
both connecting to Hummingbot API (highlighted), then to Client, then to Gateway用户可编写如下描述:
markdown
mermaid: A flowchart showing User Interface connecting to Condor and MCP Agents,
both connecting to Hummingbot API (highlighted), then to Client, then to GatewayTranslation to Mermaid
转换为Mermaid代码
Convert the description to proper Mermaid syntax:
markdown
\`\`\`mermaid
flowchart TB
A[User Interface] --> B[Condor]
A --> C[MCP Agents]
B --> D[Hummingbot API]
C --> D
D --> E[Hummingbot Client]
E --> F[Gateway]
style D fill:#00D084,color:#fff
\`\`\`将描述转换为标准Mermaid语法:
markdown
\`\`\`mermaid
flowchart TB
A[User Interface] --> B[Condor]
A --> C[MCP Agents]
B --> D[Hummingbot API]
C --> D
D --> E[Hummingbot Client]
E --> F[Gateway]
style D fill:#00D084,color:#fff
\`\`\`Diagram Types
图表类型
- - Top-down flowchart
flowchart TD - - Left-right flowchart
flowchart LR - - API and interaction flows
sequenceDiagram - - Object-oriented design
classDiagram - - Database schemas
erDiagram
- - 自上而下的流程图
flowchart TD - - 从左到右的流程图
flowchart LR - - API与交互流程
sequenceDiagram - - 面向对象设计
classDiagram - - 数据库架构
erDiagram
Highlighting
高亮设置
Use for Hummingbot green highlighting.
style NodeName fill:#00D084,color:#fff使用实现Hummingbot品牌绿色高亮。
style NodeName fill:#00D084,color:#fffRequirements
依赖要求
Mermaid diagrams require the Mermaid CLI:
bash
npm install -g @mermaid-js/mermaid-cliMermaid图表需要安装Mermaid CLI:
bash
npm install -g @mermaid-js/mermaid-cliCode Blocks
代码块
Use regular ``` code blocks for ASCII art, code snippets, or preformatted text:
\markdown
\`\`\`
Price
^
| [BUY] --- Level 3
| [BUY] --- Level 2
| [BUY] --- Level 1
+-------------------> Time
\`\`\`Code blocks render with monospace font on a gray background.
使用常规的```代码块展示ASCII图形、代码片段或预格式化文本:
\markdown
\`\`\`
Price
^
| [BUY] --- Level 3
| [BUY] --- Level 2
| [BUY] --- Level 1
+-------------------> Time
\`\`\`代码块将以等宽字体和灰色背景渲染。
Two-Column Layout
双栏布局
When a slide has both bullet points AND a diagram, it automatically renders in two columns:
- Left column: Text content
- Right column: Diagram
markdown
undefined当幻灯片同时包含项目符号和图表时,将自动渲染为双栏布局:
- 左栏:文本内容
- 右栏:图表
markdown
undefined4. How It Works
4. How It Works
Key features:
- Automated order placement
- Dynamic position management
- Risk-controlled execution
- Real-time monitoring
mermaid: flowchart showing Market Data to Strategy to Orders
After translation:
```markdownKey features:
- Automated order placement
- Dynamic position management
- Risk-controlled execution
- Real-time monitoring
mermaid: flowchart showing Market Data to Strategy to Orders
转换后:
```markdown4. How It Works
4. How It Works
Key features:
- Automated order placement
- Dynamic position management
- Risk-controlled execution
- Real-time monitoring
```mermaid
flowchart TD
A[Market Data] --> B[Strategy]
B --> C[Orders]
style B fill:#00D084,color:#fff
```
undefinedKey features:
- Automated order placement
- Dynamic position management
- Risk-controlled execution
- Real-time monitoring
```mermaid
flowchart TD
A[Market Data] --> B[Strategy]
B --> C[Orders]
style B fill:#00D084,color:#fff
```
undefinedExample Markdown
示例Markdown
markdown
undefinedmarkdown
undefinedQ4 Product Update
Q4 Product Update
1. Overview
1. Overview
Today we'll cover:
- Product milestones
- Key metrics
- Roadmap preview
Today we'll cover:
- Product milestones
- Key metrics
- Roadmap preview
2. Architecture
2. Architecture
Our system components:
- User-facing interfaces
- Core API layer
- Exchange connectivity
mermaid: flowchart showing UI to API (highlighted) to Gateway
Our system components:
- User-facing interfaces
- Core API layer
- Exchange connectivity
mermaid: flowchart showing UI to API (highlighted) to Gateway
3. Key Metrics
3. Key Metrics
| Metric | Q3 | Q4 | Change |
|---|---|---|---|
| Users | 10K | 15K | +50% |
| Revenue | $100K | $150K | +50% |
| Metric | Q3 | Q4 | Change |
|---|---|---|---|
| Users | 10K | 15K | +50% |
| Revenue | $100K | $150K | +50% |
4. Q1 Roadmap
4. Q1 Roadmap
- Mobile app launch
- Enterprise tier
- International expansion
- Mobile app launch
- Enterprise tier
- International expansion
5. Questions?
5. Questions?
Thank you!
Contact: team@example.com
After translating `mermaid:` descriptions:
```markdownThank you!
Contact: team@example.com
转换`mermaid:`描述后:
```markdown2. Architecture
2. Architecture
Our system components:
- User-facing interfaces
- Core API layer
- Exchange connectivity
```mermaid
flowchart TD
A[UI] --> B[API]
B --> C[Gateway]
style B fill:#00D084,color:#fff
```
undefinedOur system components:
- User-facing interfaces
- Core API layer
- Exchange connectivity
```mermaid
flowchart TD
A[UI] --> B[API]
B --> C[Gateway]
style B fill:#00D084,color:#fff
```
undefinedDependencies
依赖项
The script will check for and install if needed:
- Python 3
- Python package (for PDF generation)
fpdf2
脚本将检查并自动安装所需依赖(若未安装):
- Python 3
- Python包(用于PDF生成)
fpdf2
Troubleshooting
故障排查
| Issue | Solution |
|---|---|
| "Python not found" | Install Python 3: |
| "fpdf2 not installed" | Run: |
| "Permission denied" | Check write permissions for output directory |
| "Empty PDF" | Verify markdown format follows the |
| 问题 | 解决方案 |
|---|---|
| "Python not found" | 安装Python 3:macOS使用 |
| "fpdf2 not installed" | 运行: |
| "Permission denied" | 检查输出目录的写入权限 |
| "Empty PDF" | 确认Markdown格式遵循 |
Scripts
脚本说明
| Script | Purpose |
|---|---|
| Main PDF generation script |
| 脚本 | 用途 |
|---|---|
| 主PDF生成脚本 |