从 Markdown 生成 PowerPoint 演示文稿的工具
Project description
pptsmith
从 Markdown 生成 PowerPoint 演示文稿的工具。
安装
pip install -e .
# or
uv tool install -e .
使用方法
pptsmith <markdown_file> [OPTIONS]
参数
MARKDOWN_FILE: Markdown 文件路径(必需)
选项
| 选项 | 说明 |
|---|---|
-t, --template PATH |
PowerPoint 模板文件(默认: template.pptx) |
-o, --output PATH |
输出文件路径(默认: 与输入文件同名的 .pptx) |
-v, --verbose |
打印每页渲染的内容 |
示例
uv sync
# 指定模板 并显示详细渲染信息
uv run pptsmith example/main.md -t template.pptx -v
Markdown 格式
使用 --- 分隔页面,每页支持:
# 标题- 一级标题作为幻灯片标题- 正文内容 - 自动填充到文本框
- 图片(相对于 Markdown 文件路径)
示例
# 第一页标题
这是第一页的正文内容。
支持多行文本。

---
# 第二页标题
第二页的内容。
模板要求
模板 PPT 的第一页作为所有页面的模板,需包含以下元素:
| 元素类型 | 命名规则 |
|---|---|
| 标题 | placeholder idx=0 |
| 文本框 | 名称包含「文本框」「Content」或「Text」 |
| 图片 | 名称包含「图片」「Picture」或「Image」 |
填充时会保留文本框的原有样式(字体、大小、颜色等)。
依赖
- python-pptx >= 0.6.21
- click >= 8.0.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pptsmith-1.0.0.tar.gz
(5.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pptsmith-1.0.0.tar.gz.
File metadata
- Download URL: pptsmith-1.0.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbea21546f6a94e4c800b888f1268c3641f839fabe4507f37d6140ed9b2e2d7d
|
|
| MD5 |
f46837c6d94a24ebef7713a04bf4c2af
|
|
| BLAKE2b-256 |
fc8ccd23d6b60b3e7160d30a383fd3088a82aacaedb86f7646fd03951476cd54
|
File details
Details for the file pptsmith-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pptsmith-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46c8616fa61aa9944aa0ec7f673ba82a0c727348d0cf8f6442f39c4290ab111c
|
|
| MD5 |
6840e6b825bf9a58bcfd8b22e2dda29d
|
|
| BLAKE2b-256 |
d6722ab8d91cdec8a5aceb68dd291b3e571ca6bb9bb4944a4aef6a1a8c5e3059
|