Skip to content

Commit f2e0ce5

Browse files
authored
Merge pull request #192 from TencentCloudADP/example/ppt
feat: add ppt-gen dependency group and update README
2 parents e5e128d + 255c66b commit f2e0ce5

3 files changed

Lines changed: 43 additions & 9 deletions

File tree

examples/ppt_gen/README.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
11
# PowerPoint Template Example
22

3-
## Quick Start
3+
## Prerequisites
44

5-
Download [template files](https://drive.google.com/drive/folders/1oZYoHBJJwzAzhrpvnUnklvU7LcS4oFz6?usp=sharing) to `examples/ppt_gen/template` directory.
5+
This example requires additional dependencies for image processing, document handling, and visualization.
66

7-
Prepare the reference resource (plain text / markdown / html webpage) for PPT generation. For example, download the [Nobel Prize webpage](https://www.nobelprize.org/prizes/physics/2025/popular-information/).
7+
**Install dependencies:**
88

9+
```bash
10+
# Navigate to project root
11+
cd youtu-agent
12+
13+
# Install PPT generation dependencies
14+
uv sync --extra ppt-gen
915
```
10-
wget https://www.nobelprize.org/prizes/physics/2025/popular-information/ -O webpage.html
11-
```
1216

13-
`cd` into `examples/ppt_gen`
17+
## Quick Start
18+
19+
Download [template files](https://cdn.jsdelivr.net/gh/TencentCloudADP-DevRel/picgo-images@main/assets/templates.zip) to `examples/ppt_gen/templates` directory.
20+
21+
Navigate to the example directory, prepare the reference resource (plain text / markdown / html webpage) for PPT generation. For example, download the [Nobel Prize webpage](https://www.nobelprize.org/prizes/physics/2025/popular-information/).
1422

15-
Run `main.py`
23+
```bash
24+
# Navigate to the example directory
25+
cd examples/ppt_gen
1626

27+
# Download sample webpage
28+
wget https://www.nobelprize.org/prizes/physics/2025/popular-information/ -O webpage.html
1729
```
18-
python main.py --file webpage.html --template_path template/0.pptx --pages 15
30+
31+
Run the PPT generation script.
32+
33+
```python
34+
python main.py --file webpage.html --template_path templates/0.pptx --pages 15
1935
```
2036

2137
The script will produce a `json` file and a `pptx` file if everything is OK.

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ utils = [
8383
"docker>=7.1.0",
8484
"tiktoken>=0.11.0",
8585
]
86+
# PPT generation example dependencies
87+
ppt-gen = [
88+
"pillow>=11.3.0",
89+
"python-pptx>=1.0.2",
90+
"pymupdf>=1.26.4",
91+
"matplotlib>=3.10.6",
92+
]
93+
8694

8795

8896
[dependency-groups]

uv.lock

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)