slides-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

slides-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
undefined

Presentation 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, links
And 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
undefined

Save 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
undefined
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
undefined

Step 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:
  1. Read the original markdown (if available) or view the PDF to understand current content
  2. Ask the user what changes they want:
    • Edit specific slide content
    • Add new slides
    • Remove slides
    • Reorder slides
  3. Apply changes to the markdown
  4. Regenerate the PDF
Use the
--edit
flag to update specific slides without regenerating all:
bash
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对应的幻灯片:
  1. 读取原始Markdown(若可用)或查看PDF以了解当前内容
  2. 询问用户需要的修改:
    • 编辑特定幻灯片内容
    • 添加新幻灯片
    • 删除幻灯片
    • 调整幻灯片顺序
  3. 对Markdown内容应用修改
  4. 重新生成PDF
使用
--edit
标记可更新特定幻灯片,无需重新生成全部:
bash
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

Diagrams

图表

Users can describe diagrams in natural language using
mermaid:
syntax. You must translate these descriptions to Mermaid code before generating the PDF.
用户可使用
mermaid:
语法以自然语言描述图表。生成PDF前,你必须将这些描述转换为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 Gateway

Translation 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

图表类型

  • flowchart TD
    - Top-down flowchart
  • flowchart LR
    - Left-right flowchart
  • sequenceDiagram
    - API and interaction flows
  • classDiagram
    - Object-oriented design
  • erDiagram
    - Database schemas
  • flowchart TD
    - 自上而下的流程图
  • flowchart LR
    - 从左到右的流程图
  • sequenceDiagram
    - API与交互流程
  • classDiagram
    - 面向对象设计
  • erDiagram
    - 数据库架构

Highlighting

高亮设置

Use
style NodeName fill:#00D084,color:#fff
for Hummingbot green highlighting.
使用
style NodeName fill:#00D084,color:#fff
实现Hummingbot品牌绿色高亮。

Requirements

依赖要求

Mermaid diagrams require the Mermaid CLI:
bash
npm install -g @mermaid-js/mermaid-cli
Mermaid图表需要安装Mermaid CLI:
bash
npm install -g @mermaid-js/mermaid-cli

Code 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
undefined

4. 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:
```markdown
Key features:
  • Automated order placement
  • Dynamic position management
  • Risk-controlled execution
  • Real-time monitoring
mermaid: flowchart showing Market Data to Strategy to Orders

转换后:
```markdown

4. 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 ```
undefined
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 ```
undefined

Example Markdown

示例Markdown

markdown
undefined
markdown
undefined

Q4 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

MetricQ3Q4Change
Users10K15K+50%
Revenue$100K$150K+50%
MetricQ3Q4Change
Users10K15K+50%
Revenue$100K$150K+50%

4. Q1 Roadmap

4. Q1 Roadmap

  1. Mobile app launch
  2. Enterprise tier
  3. International expansion
  1. Mobile app launch
  2. Enterprise tier
  3. International expansion

5. Questions?

5. Questions?

Thank you!
Contact: team@example.com

After translating `mermaid:` descriptions:

```markdown
Thank you!
Contact: team@example.com

转换`mermaid:`描述后:

```markdown

2. 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 ```
undefined
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 ```
undefined

Dependencies

依赖项

The script will check for and install if needed:
  • Python 3
  • fpdf2
    Python package (for PDF generation)
脚本将检查并自动安装所需依赖(若未安装):
  • Python 3
  • fpdf2
    Python包(用于PDF生成)

Troubleshooting

故障排查

IssueSolution
"Python not found"Install Python 3:
brew install python3
(macOS) or
apt install python3
(Linux)
"fpdf2 not installed"Run:
pip3 install fpdf2
"Permission denied"Check write permissions for output directory
"Empty PDF"Verify markdown format follows the
## N. Title
pattern
问题解决方案
"Python not found"安装Python 3:macOS使用
brew install python3
,Linux使用
apt install python3
"fpdf2 not installed"运行:
pip3 install fpdf2
"Permission denied"检查输出目录的写入权限
"Empty PDF"确认Markdown格式遵循
## N. Title
的规则

Scripts

脚本说明

ScriptPurpose
generate_slides.sh
Main PDF generation script
脚本用途
generate_slides.sh
主PDF生成脚本