Skip to content

Commit 7cbb72f

Browse files
committed
docs: add comprehensive documentation for TPPT, including installation, usage, and API reference
1 parent 5092bba commit 7cbb72f

File tree

8 files changed

+643
-0
lines changed

8 files changed

+643
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ Thumbs.db
4444
# TypeScript
4545
node_modules/
4646
examples/*.pptx
47+
48+
# Docs
49+
site/

docs/docs/api.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# API Reference
2+
3+
## Presentation
4+
5+
### Constructor
6+
7+
```python
8+
Presentation(template: Optional[str] = None)
9+
```
10+
11+
Creates a new presentation, optionally using a template.
12+
13+
### Methods
14+
15+
#### add_slide
16+
17+
```python
18+
def add_slide(self, layout: Optional[str] = None) -> Slide
19+
```
20+
21+
Adds a new slide to the presentation.
22+
23+
#### save
24+
25+
```python
26+
def save(self, filename: str, format: Optional[str] = None)
27+
```
28+
29+
Saves the presentation to a file.
30+
31+
## Slide
32+
33+
### Methods
34+
35+
#### add_title
36+
37+
```python
38+
def add_title(self, text: str) -> Shape
39+
```
40+
41+
Adds a title to the slide.
42+
43+
#### add_text
44+
45+
```python
46+
def add_text(self, text: str, x: Optional[float] = None, y: Optional[float] = None) -> Shape
47+
```
48+
49+
Adds text to the slide at the specified position.
50+
51+
#### add_image
52+
53+
```python
54+
def add_image(
55+
self,
56+
image_path: str,
57+
x: Optional[float] = None,
58+
y: Optional[float] = None,
59+
width: Optional[float] = None,
60+
height: Optional[float] = None
61+
) -> Shape
62+
```
63+
64+
Adds an image to the slide.
65+
66+
#### add_table
67+
68+
```python
69+
def add_table(
70+
self,
71+
data: List[List[Any]],
72+
x: Optional[float] = None,
73+
y: Optional[float] = None,
74+
width: Optional[float] = None,
75+
height: Optional[float] = None
76+
) -> Shape
77+
```
78+
79+
Adds a table to the slide.
80+
81+
#### add_shape
82+
83+
```python
84+
def add_shape(
85+
self,
86+
shape_type: str,
87+
x: float,
88+
y: float,
89+
width: float,
90+
height: float
91+
) -> Shape
92+
```
93+
94+
Adds a shape to the slide.
95+
96+
## Shape
97+
98+
### Properties
99+
100+
- `fill_color: str` - The fill color of the shape
101+
- `line_color: str` - The line color of the shape
102+
- `line_width: float` - The line width of the shape
103+
- `text: str` - The text content of the shape
104+
- `font_name: str` - The font name for text
105+
- `font_size: float` - The font size for text
106+
- `font_bold: bool` - Whether the text is bold
107+
- `font_italic: bool` - Whether the text is italic
108+
109+
### Methods
110+
111+
#### set_position
112+
113+
```python
114+
def set_position(self, x: float, y: float)
115+
```
116+
117+
Sets the position of the shape.
118+
119+
#### set_size
120+
121+
```python
122+
def set_size(self, width: float, height: float)
123+
```
124+
125+
Sets the size of the shape.
126+
127+
## DataFrameSupport
128+
129+
When using the pandas or polars support:
130+
131+
### Methods
132+
133+
#### add_dataframe
134+
135+
```python
136+
def add_dataframe(
137+
self,
138+
df: Union[pd.DataFrame, pl.DataFrame],
139+
x: Optional[float] = None,
140+
y: Optional[float] = None,
141+
width: Optional[float] = None,
142+
height: Optional[float] = None
143+
) -> Shape
144+
```
145+
146+
Adds a data frame as a table to the slide.

docs/docs/contributing.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Contributing to TPPT
2+
3+
We welcome contributions to TPPT! This document provides guidelines and instructions for contributing to the project.
4+
5+
## Development Setup
6+
7+
1. Fork and clone the repository:
8+
```bash
9+
git clone https://github.com/yourusername/tppt.git
10+
cd tppt
11+
```
12+
13+
2. Create a virtual environment and install dependencies:
14+
```bash
15+
python -m venv .venv
16+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
17+
uv pip install -e ".[dev]"
18+
```
19+
20+
## Development Tools
21+
22+
TPPT uses several development tools:
23+
24+
- **mypy**: Static type checking
25+
- **pyright**: Additional type checking
26+
- **ruff**: Code formatting and linting
27+
- **pytest**: Testing framework
28+
29+
You can run all checks using:
30+
31+
```bash
32+
task ci
33+
```
34+
35+
Or run individual checks:
36+
37+
```bash
38+
# Format code
39+
task format
40+
41+
# Run linter
42+
task lint
43+
44+
# Run type checker
45+
task typecheck
46+
47+
# Run tests
48+
task test
49+
```
50+
51+
## Pull Request Process
52+
53+
1. Create a new branch for your feature:
54+
```bash
55+
git checkout -b feature/your-feature-name
56+
```
57+
58+
2. Make your changes and commit them:
59+
```bash
60+
git add .
61+
git commit -m "Add your feature description"
62+
```
63+
64+
3. Ensure all tests pass:
65+
```bash
66+
task ci
67+
```
68+
69+
4. Push your changes and create a pull request:
70+
```bash
71+
git push origin feature/your-feature-name
72+
```
73+
74+
5. Create a Pull Request on GitHub
75+
76+
## Code Style
77+
78+
- Follow PEP 8 guidelines
79+
- Use type hints for all function parameters and return values
80+
- Write docstrings for all public functions and classes
81+
- Keep functions focused and single-purpose
82+
- Write tests for new features
83+
84+
## Testing
85+
86+
- Write unit tests for new features
87+
- Ensure all tests pass before submitting a pull request
88+
- Add integration tests for complex features
89+
- Test edge cases and error conditions
90+
91+
## Documentation
92+
93+
When adding new features, please:
94+
95+
1. Add docstrings to all new functions and classes
96+
2. Update the relevant documentation files
97+
3. Add examples if appropriate
98+
4. Update the changelog
99+
100+
## Questions or Issues?
101+
102+
If you have questions or run into issues:
103+
104+
1. Check the existing issues on GitHub
105+
2. Create a new issue if needed
106+
3. Join our community discussions
107+
108+
Thank you for contributing to TPPT!

0 commit comments

Comments
 (0)