Skip to content

Commit 0cbdb5b

Browse files
committed
chore: update documentation dependencies and add mkdocstrings plugin for enhanced API documentation
1 parent 7cbb72f commit 0cbdb5b

File tree

4 files changed

+512
-144
lines changed

4 files changed

+512
-144
lines changed

docs/docs/api.md

Lines changed: 12 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,14 @@
11
# API Reference
22

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.
3+
::: tppt
4+
options:
5+
show_root_heading: true
6+
show_root_full_path: false
7+
show_category_heading: true
8+
show_if_no_docstring: true
9+
show_signature_annotations: true
10+
show_bases: true
11+
show_submodules: true
12+
group_by_category: true
13+
heading_level: 2
14+
members_order: source

docs/mkdocs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ theme:
1919
repo_name: yassun7010/tppt
2020
repo_url: https://github.com/yassun7010/tppt
2121

22+
plugins:
23+
- mkdocstrings:
24+
default_handler: python
25+
handlers:
26+
python:
27+
rendering:
28+
show_source: true
29+
show_root_heading: true
30+
show_root_full_path: false
31+
show_category_heading: true
32+
show_if_no_docstring: true
33+
show_signature_annotations: true
34+
show_bases: true
35+
show_submodules: true
36+
group_by_category: true
37+
heading_level: 2
38+
members_order: source
39+
selection:
40+
docstring_style: google
41+
paths: [src]
42+
2243
markdown_extensions:
2344
- pymdownx.highlight:
2445
anchor_linenums: true

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ dev = [
5252
docs = [
5353
"mkdocs-material>=9.6.12",
5454
"mkdocs>=1.6.1",
55+
"mkdocstrings-python>=1.10.0",
56+
"mkdocstrings>=0.25.0",
5557
]
5658
rich = ["rich", "rich-argparse"]
5759

@@ -72,6 +74,9 @@ testpaths = ["tests"]
7274

7375
[tool.taskipy.tasks]
7476
ci = "task format && task lint && task typecheck && task test"
77+
doc = "cd docs && mkdocs serve"
78+
doc-build = "cd docs && mkdocs build"
79+
doc-deploy = "cd docs && mkdocs gh-deploy"
7580
format = "ruff format"
7681
format-check = "ruff format --check"
7782
lint = "ruff check"

0 commit comments

Comments
 (0)