html-to-ppt by claude-office-skills/skills
npx skills add https://github.com/claude-office-skills/skills --skill html-to-ppt此技能支持使用 Marp(Markdown 演示文稿生态系统)将 Markdown 或 HTML 转换为专业的 PowerPoint 演示文稿。使用简单的 Markdown 语法和基于 CSS 的主题,创建美观、一致的幻灯片。
示例提示:
Marp 使用简单的语法,其中 --- 用于分隔幻灯片:
---
marp: true
theme: default
---
# 幻灯片 1 标题
第一张幻灯片的内容
---
# 幻灯片 2 标题
第二张幻灯片的内容
# 转换为 PowerPoint
marp slides.md -o presentation.pptx
# 转换为 PDF
marp slides.md -o presentation.pdf
# 转换为 HTML
marp slides.md -o presentation.html
# 使用特定主题
marp slides.md --theme gaia -o presentation.pptx
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
---
marp: true
---
# 标题
- 要点 1
- 要点 2
- 要点 3
---
marp: true
theme: gaia
class: lead
---
# 演示文稿标题
## 副标题
作者姓名
日期
---
marp: true
theme: default # default, gaia, uncover
size: 16:9 # 4:3, 16:9, 或自定义
paginate: true # 显示页码
header: '公司名称' # 页眉文本
footer: '机密' # 页脚文本
backgroundColor: #fff
backgroundImage: url('bg.png')
---
---
marp: true
theme: default # 简洁、极简
---
---
marp: true
theme: gaia # 多彩、现代
---
---
marp: true
theme: uncover # 大胆、专注于演示
---
---
marp: true
theme: gaia
class: lead # 居中的标题幻灯片
---
---
marp: true
theme: gaia
class: invert # 反转颜色
---
# 标题 1
## 标题 2
**粗体文本** 和 *斜体文本*
`行内代码`
> 用于强调的引用块
- 无序项目
- 另一个项目
- 嵌套项目
1. 有序项目
2. 第二个项目
1. 嵌套编号
# 代码示例
```python
def hello():
print("Hello, World!")
```
| 功能 | 状态 |
|---------|--------|
| 表格 | ✅ |
| 图表 | ✅ |
| 图片 | ✅ |




---
marp: true
backgroundImage: url('background.jpg')
---
# 带背景的幻灯片
---
marp: true
style: |
.columns {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
}
---
# 两列布局
<div class="columns">
<div>
## 左列
- 要点 1
- 要点 2
</div>
<div>
## 右列
- 要点 A
- 要点 B
</div>
</div>
---
marp: true
theme: gaia
class: gaia
---
<!--
_backgroundImage: linear-gradient(to right, #4a90a4, #4a90a4 50%, white 50%)
-->
<div class="columns">
<div style="color: white;">
# 深色侧
</div>
<div>
# 浅色侧
</div>
</div>
---
marp: true
---
<!--
_backgroundColor: #123
_color: white
_paginate: false
-->
# 特殊幻灯片
---
marp: true
---
<style scoped>
h1 {
color: red;
}
</style>
# 此标题为红色
import subprocess
import tempfile
import os
def markdown_to_pptx(md_content, output_path, theme='default'):
"""使用 Marp 将 Markdown 转换为 PowerPoint。"""
# 如果不存在则添加 marp 指令
if '---\nmarp: true' not in md_content:
md_content = f"---\nmarp: true\ntheme: {theme}\n---\n\n" + md_content
# 写入临时文件
with tempfile.NamedTemporaryFile(mode='w', suffix='.md', delete=False) as f:
f.write(md_content)
temp_path = f.name
try:
# 使用 marp 转换
subprocess.run([
'marp', temp_path, '-o', output_path
], check=True)
return output_path
finally:
os.unlink(temp_path)
# 用法
md = """
# 欢迎
介绍幻灯片
---
# 议程
- 主题 1
- 主题 2
- 主题 3
"""
markdown_to_pptx(md, 'presentation.pptx')
const { marpCli } = require('@marp-team/marp-cli');
// 转换文件
marpCli(['slides.md', '-o', 'output.pptx']).then(exitCode => {
console.log('完成:', exitCode);
});
def create_presentation(title, sections, output_path, theme='gaia'):
"""从结构化数据生成演示文稿。"""
md_content = f"""---
marp: true
theme: {theme}
paginate: true
---
<!-- _class: lead -->
# {title}
{sections.get('subtitle', '')}
{sections.get('author', '')}
"""
for section in sections.get('slides', []):
md_content += f"""---
# {section['title']}
"""
for point in section.get('points', []):
md_content += f"- {point}\n"
if section.get('notes'):
md_content += f"\n<!-- 备注: {section['notes']} -->\n"
md_content += """---
<!-- _class: lead -->
# 谢谢!
有问题吗?
"""
return markdown_to_pptx(md_content, output_path, theme)
def generate_report_slides(data_list, template, output_dir):
"""从数据生成多个演示文稿。"""
import os
for data in data_list:
content = template.format(**data)
output_path = os.path.join(output_dir, f"{data['name']}_report.pptx")
markdown_to_pptx(content, output_path)
---
marp: true
theme: gaia
class: lead
paginate: true
---
# API 文档
## REST API 最佳实践
工程团队
2024年1月
---
# 议程
1. 认证
2. 端点概览
3. 错误处理
4. 速率限制
5. 示例
---
# 认证
所有请求都需要 API 密钥:
```http
Authorization: Bearer YOUR_API_KEY
| 方法 | 端点 | 描述 |
|---|---|---|
| GET | /users | 列出所有用户 |
| POST | /users | 创建用户 |
| GET | /users/:id | 获取用户详情 |
| PUT | /users/:id | 更新用户 |
| DELETE | /users/:id | 删除用户 |
{
"error": {
"code": "VALIDATION_ERROR",
"message": "无效的电子邮件格式",
"details": ["email 必须有效"]
}
}
### 示例 2:商业路演
```python
def create_pitch_deck(company_data):
"""生成投资者路演文稿。"""
md = f"""---
marp: true
theme: uncover
paginate: true
---
<!-- _class: lead -->
<!-- _backgroundColor: #2d3748 -->
<!-- _color: white -->
# {company_data['name']}
{company_data['tagline']}
---
# 问题
{company_data['problem_statement']}
**市场痛点:**
"""
for pain in company_data['pain_points']:
md += f"- {pain}\n"
md += f"""
---
# 我们的解决方案
{company_data['solution']}
})
---
# 市场机会
- **TAM:** {company_data['tam']}
- **SAM:** {company_data['sam']}
- **SOM:** {company_data['som']}
---
# 进展
| 指标 | 数值 |
|--------|-------|
| 月收入 | {company_data['mrr']} |
| 客户数 | {company_data['customers']} |
| 增长率 | {company_data['growth']} |
---
# 融资需求
**寻求:** {company_data['funding_ask']}
**资金用途:**
- 产品开发: 40%
- 销售与市场: 35%
- 运营: 25%
---
<!-- _class: lead -->
# 让我们一起构建未来
{company_data['contact']}
"""
return md
# 生成文稿
pitch_data = {
'name': 'TechStartup Inc',
'tagline': 'AI 驱动的文档处理',
'problem_statement': '企业浪费 20% 的时间在手动文档工作上',
'pain_points': ['手动数据录入', '易出错流程', '周转缓慢'],
'solution': '自动化文档处理,准确率达 99.5%',
'tam': '$500亿',
'sam': '$100亿',
'som': '$5亿',
'mrr': '$10万',
'customers': '50',
'growth': '20% 月环比',
'funding_ask': '$500万 A轮',
'contact': 'founders@techstartup.com'
}
md_content = create_pitch_deck(pitch_data)
markdown_to_pptx(md_content, 'pitch_deck.pptx', theme='uncover')
# 使用 npm
npm install -g @marp-team/marp-cli
# 使用 Homebrew
brew install marp-cli
# 验证安装
marp --version
每周安装量
21
代码仓库
GitHub 星标数
5
首次出现
1 天前
安全审计
已安装于
claude-code19
opencode4
github-copilot4
codex4
amp4
cline4
This skill enables conversion from Markdown or HTML to professional PowerPoint presentations using Marp (Markdown Presentation Ecosystem). Create beautiful, consistent slides using simple Markdown syntax with CSS-based themes.
Example prompts:
Marp uses a simple syntax where --- separates slides:
---
marp: true
theme: default
---
# Slide 1 Title
Content for first slide
---
# Slide 2 Title
Content for second slide
# Convert to PowerPoint
marp slides.md -o presentation.pptx
# Convert to PDF
marp slides.md -o presentation.pdf
# Convert to HTML
marp slides.md -o presentation.html
# With specific theme
marp slides.md --theme gaia -o presentation.pptx
---
marp: true
---
# Title
- Bullet point 1
- Bullet point 2
- Bullet point 3
---
marp: true
theme: gaia
class: lead
---
# Presentation Title
## Subtitle
Author Name
Date
---
marp: true
theme: default # default, gaia, uncover
size: 16:9 # 4:3, 16:9, or custom
paginate: true # Show page numbers
header: 'Company Name' # Header text
footer: 'Confidential' # Footer text
backgroundColor: #fff
backgroundImage: url('bg.png')
---
---
marp: true
theme: default # Clean, minimal
---
---
marp: true
theme: gaia # Colorful, modern
---
---
marp: true
theme: uncover # Bold, presentation-focused
---
---
marp: true
theme: gaia
class: lead # Centered title slide
---
---
marp: true
theme: gaia
class: invert # Inverted colors
---
# Heading 1
## Heading 2
**Bold text** and *italic text*
`inline code`
> Blockquote for emphasis
- Unordered item
- Another item
- Nested item
1. Ordered item
2. Second item
1. Nested numbered
# Code Example
\`\`\`python
def hello():
print("Hello, World!")
\`\`\`
| Feature | Status |
|---------|--------|
| Tables | ✅ |
| Charts | ✅ |
| Images | ✅ |




---
marp: true
backgroundImage: url('background.jpg')
---
# Slide with Background
---
marp: true
style: |
.columns {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
}
---
# Two Column Layout
<div class="columns">
<div>
## Left Column
- Point 1
- Point 2
</div>
<div>
## Right Column
- Point A
- Point B
</div>
</div>
---
marp: true
theme: gaia
class: gaia
---
<!--
_backgroundImage: linear-gradient(to right, #4a90a4, #4a90a4 50%, white 50%)
-->
<div class="columns">
<div style="color: white;">
# Dark Side
</div>
<div>
# Light Side
</div>
</div>
---
marp: true
---
<!--
_backgroundColor: #123
_color: white
_paginate: false
-->
# Special Slide
---
marp: true
---
<style scoped>
h1 {
color: red;
}
</style>
# This Title is Red
import subprocess
import tempfile
import os
def markdown_to_pptx(md_content, output_path, theme='default'):
"""Convert Markdown to PowerPoint using Marp."""
# Add marp directive if not present
if '---\nmarp: true' not in md_content:
md_content = f"---\nmarp: true\ntheme: {theme}\n---\n\n" + md_content
# Write to temp file
with tempfile.NamedTemporaryFile(mode='w', suffix='.md', delete=False) as f:
f.write(md_content)
temp_path = f.name
try:
# Convert using marp
subprocess.run([
'marp', temp_path, '-o', output_path
], check=True)
return output_path
finally:
os.unlink(temp_path)
# Usage
md = """
# Welcome
Introduction slide
---
# Agenda
- Topic 1
- Topic 2
- Topic 3
"""
markdown_to_pptx(md, 'presentation.pptx')
const { marpCli } = require('@marp-team/marp-cli');
// Convert file
marpCli(['slides.md', '-o', 'output.pptx']).then(exitCode => {
console.log('Done:', exitCode);
});
def create_presentation(title, sections, output_path, theme='gaia'):
"""Generate presentation from structured data."""
md_content = f"""---
marp: true
theme: {theme}
paginate: true
---
<!-- _class: lead -->
# {title}
{sections.get('subtitle', '')}
{sections.get('author', '')}
"""
for section in sections.get('slides', []):
md_content += f"""---
# {section['title']}
"""
for point in section.get('points', []):
md_content += f"- {point}\n"
if section.get('notes'):
md_content += f"\n<!-- Notes: {section['notes']} -->\n"
md_content += """---
<!-- _class: lead -->
# Thank You!
Questions?
"""
return markdown_to_pptx(md_content, output_path, theme)
def generate_report_slides(data_list, template, output_dir):
"""Generate multiple presentations from data."""
import os
for data in data_list:
content = template.format(**data)
output_path = os.path.join(output_dir, f"{data['name']}_report.pptx")
markdown_to_pptx(content, output_path)
---
marp: true
theme: gaia
class: lead
paginate: true
---
# API Documentation
## REST API Best Practices
Engineering Team
January 2024
---
# Agenda
1. Authentication
2. Endpoints Overview
3. Error Handling
4. Rate Limiting
5. Examples
---
# Authentication
All requests require an API key:
```http
Authorization: Bearer YOUR_API_KEY
| Method | Endpoint | Description |
|---|---|---|
| GET | /users | List all users |
| POST | /users | Create user |
| GET | /users/:id | Get user details |
| PUT | /users/:id | Update user |
| DELETE | /users/:id | Delete user |
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid email format",
"details": ["email must be valid"]
}
}
### Example 2: Business Pitch
```python
def create_pitch_deck(company_data):
"""Generate investor pitch deck."""
md = f"""---
marp: true
theme: uncover
paginate: true
---
<!-- _class: lead -->
<!-- _backgroundColor: #2d3748 -->
<!-- _color: white -->
# {company_data['name']}
{company_data['tagline']}
---
# The Problem
{company_data['problem_statement']}
**Market Pain Points:**
"""
for pain in company_data['pain_points']:
md += f"- {pain}\n"
md += f"""
---
# Our Solution
{company_data['solution']}
})
---
# Market Opportunity
- **TAM:** {company_data['tam']}
- **SAM:** {company_data['sam']}
- **SOM:** {company_data['som']}
---
# Traction
| Metric | Value |
|--------|-------|
| Monthly Revenue | {company_data['mrr']} |
| Customers | {company_data['customers']} |
| Growth Rate | {company_data['growth']} |
---
# The Ask
**Seeking:** {company_data['funding_ask']}
**Use of Funds:**
- Product Development: 40%
- Sales & Marketing: 35%
- Operations: 25%
---
<!-- _class: lead -->
# Let's Build the Future Together
{company_data['contact']}
"""
return md
# Generate deck
pitch_data = {
'name': 'TechStartup Inc',
'tagline': 'AI-Powered Document Processing',
'problem_statement': 'Businesses waste 20% of time on manual document work',
'pain_points': ['Manual data entry', 'Error-prone processes', 'Slow turnaround'],
'solution': 'Automated document processing with 99.5% accuracy',
'tam': '$50B',
'sam': '$10B',
'som': '$500M',
'mrr': '$100K',
'customers': '50',
'growth': '20% MoM',
'funding_ask': '$5M Series A',
'contact': 'founders@techstartup.com'
}
md_content = create_pitch_deck(pitch_data)
markdown_to_pptx(md_content, 'pitch_deck.pptx', theme='uncover')
# Using npm
npm install -g @marp-team/marp-cli
# Using Homebrew
brew install marp-cli
# Verify installation
marp --version
Weekly Installs
21
Repository
GitHub Stars
5
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code19
opencode4
github-copilot4
codex4
amp4
cline4
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
27,400 周安装