-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocs.py
More file actions
55 lines (46 loc) · 1.36 KB
/
docs.py
File metadata and controls
55 lines (46 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python3
"""
Documentation generation script for the Cuttle Bot project.
This script generates HTML documentation using pdoc.
"""
import pdoc
from pathlib import Path
def generate_docs() -> None:
"""
Generate documentation for the project.
"""
# Define the output directory
output_dir = Path("docs")
output_dir.mkdir(exist_ok=True)
# Define the modules to document
modules = [
"game",
"game.game",
"game.game_state",
"game.card",
"game.action",
"game.ai_player",
"game.input_handler",
"game.serializer",
"game.utils",
"main",
]
# Generate documentation
pdoc.render.configure(
docformat="google", # Use Google-style docstrings
show_source=True, # Show source code
)
# Generate documentation for each module
for module in modules:
try:
pdoc.pdoc(
*modules,
output_directory=output_dir,
)
print(f"Generated documentation for {module}")
except Exception as e:
print(f"Error generating documentation for {module}: {e}")
print(f"\nDocumentation generated in {output_dir.absolute()}")
print("You can view the documentation by opening docs/index.html in your browser")
if __name__ == "__main__":
generate_docs()