-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate.py
More file actions
34 lines (27 loc) · 795 Bytes
/
create.py
File metadata and controls
34 lines (27 loc) · 795 Bytes
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
import os
# Files and folders for the documentation
docs_files = [
"index.html",
"getting_started.html",
"api.html",
"examples.html"
]
docs_assets = [
"style.css",
"logo.png"
]
# Base documentation folder
base_docs = "pylove2d_docs"
assets_folder = os.path.join(base_docs, "assets")
# Function to create empty file and its parent directories
def create_file(path):
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, "w", encoding="utf-8") as f:
f.write("") # empty file
# Create HTML files in the root of docs
for file in docs_files:
create_file(os.path.join(base_docs, file))
# Create assets files
for file in docs_assets:
create_file(os.path.join(assets_folder, file))
print("✅ Documentation folder structure created!")