从 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-0.1.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-0.1.0.tar.gz.
File metadata
- Download URL: pptsmith-0.1.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 |
80496b6081db67e775e610bf3009cecb398c8e40a6cb0f5d02730a6c57197c6f
|
|
| MD5 |
767084255053cf39e8c1768a11018c65
|
|
| BLAKE2b-256 |
4e74d7206bdf034554f1475794d05441fa92713306ce4dffcaf3d626b54f57b5
|
File details
Details for the file pptsmith-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pptsmith-0.1.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 |
7c2c8161ee54821a2adac92534147696e4289754ebd12c176ea31b71d34e98da
|
|
| MD5 |
0ba6d6e0e610e9427d52984ae63f7d9c
|
|
| BLAKE2b-256 |
445044d1c63156b2cca114786bd266012a612f816b4c89970b0095007f84a9b0
|