Skip to content

Commit 29d6cbf

Browse files
committed
docs: add example script for visualizing presentation tree structure
1 parent 11b4cb4 commit 29d6cbf

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

docs/docs/codes/pptx_tree.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import json
2+
3+
import tppt
4+
5+
print(json.dumps(tppt.Presentation("your.pptx").tree, indent=2, ensure_ascii=False))

docs/docs/usage/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ By using the builder, you can create slides while utilizing slide masters and sl
1414
Also, `tppt.Presentation` has a property called `tree`,
1515
which is a dictionary representing the tree structure of the presentation.
1616

17+
```python
18+
--8<-- "codes/pptx_tree.py"
19+
```
20+
1721
It is used for automatic generation of slide master type definitions and can also be used to analyze how pptx files are structured.

0 commit comments

Comments
 (0)