-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_docs.py
32 lines (28 loc) · 1.02 KB
/
build_docs.py
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
import os
import subprocess
import sys
def install_dependencies():
"""Install MkDocs and the necessary plugins."""
try:
# Check if MkDocs is installed
subprocess.run([sys.executable, "-m", "pip", "install", "mkdocs"], check=True)
subprocess.run([sys.executable, "-m", "pip", "install", "mkdocs-material"], check=True)
print("Successfully installed MkDocs and MkDocs Material.")
except subprocess.CalledProcessError as e:
print("Error installing dependencies:", e)
sys.exit(1)
def build_docs():
"""Build the documentation using MkDocs."""
try:
subprocess.run(["mkdocs", "build"], check=True)
print("Documentation built successfully.")
except subprocess.CalledProcessError as e:
print("Error building documentation:", e)
sys.exit(1)
def main():
print("Starting the documentation build process...")
install_dependencies()
build_docs()
print("Documentation build process completed.")
if __name__ == "__main__":
main()