Skip to content

Commit d9378c0

Browse files
committed
feat: add example script and update documentation for clarity
1 parent 218f833 commit d9378c0

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

docs/docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We welcome contributions to TPPT! This document provides guidelines and instruct
66

77
1. Fork and clone the repository:
88
```bash
9-
git clone https://github.com/yourusername/tppt.git
9+
git clone https://github.com/yassun7010/tppt.git
1010
cd tppt
1111
```
1212

docs/docs/examples/simple.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import tppt
2+
3+
(
4+
tppt.Presentation.builder()
5+
.slide(
6+
lambda slide: slide.BlankLayout()
7+
.builder()
8+
.text(
9+
"Hello, World!",
10+
left=(1, "in"),
11+
top=(1, "in"),
12+
width=(5, "in"),
13+
height=(2, "in"),
14+
)
15+
)
16+
.build()
17+
.save("simple.pptx")
18+
)

docs/docs/index.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,7 @@ TPPT (Typed Python PowerPoint Tool) is a Python library for creating and manipul
1212
## Quick Start
1313

1414
```python
15-
from tppt import Presentation
16-
17-
# Create a new presentation
18-
presentation = Presentation()
19-
20-
# Add a slide
21-
slide = presentation.add_slide()
22-
23-
# Add content to the slide
24-
slide.add_title("Hello, World!")
25-
slide.add_text("This is a sample slide.")
26-
27-
# Save the presentation
28-
presentation.save("example.pptx")
15+
--8<-- "docs/examples/simple.py"
2916
```
3017

3118
## Getting Started

docs/mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ markdown_extensions:
5454
- pymdownx.highlight:
5555
anchor_linenums: true
5656
- pymdownx.inlinehilite
57-
- pymdownx.snippets
57+
- pymdownx.snippets:
58+
base_path: docs
5859
- pymdownx.superfences
5960
- pymdownx.tabbed:
6061
alternate_style: true

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ docs = [
5454
"mkdocs>=1.6.1",
5555
"mkdocstrings-python>=1.10.0",
5656
"mkdocstrings>=0.25.0",
57+
"pymdown-extensions>=10.15",
5758
]
5859
rich = ["rich", "rich-argparse"]
5960

uv.lock

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)