-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.py
33 lines (25 loc) · 892 Bytes
/
build.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
33
"""Render the design docs into HTML."""
import argparse
import subprocess
import sys
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"-o", "--output", help="Output directory where HTML will reside",
default="html")
args = parser.parse_args()
output_dir = str(args.output)
run = subprocess.run(['mkdocs', '--version'])
if run.returncode != 0:
print(
"The `mkdocs` has not been installed. "
"Have you installed it on your system or your virtual environment?",
file=sys.stderr)
return 1
print("Building the site with mkdocs...")
subprocess.check_call(['mkdocs', 'build', '--strict', '--site-dir', output_dir])
print()
print("You can serve the website with: mkdocs serve")
return 0
if __name__ == "__main__":
sys.exit(main())