Skip to content

Commit 7077d52

Browse files
committed
tool to build documentation using meson
1 parent dc7acee commit 7077d52

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

build-doc.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python3
2+
import os
3+
import sys
4+
import logging
5+
import bootstrap
6+
from sphinx.cmd.build import main
7+
logger = logging.getLogger(__name__)
8+
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
9+
PROJECT_NAME = bootstrap.get_project_name(PROJECT_DIR)
10+
logger.info("Project name: %s", PROJECT_NAME)
11+
LIBPATH = bootstrap.build_project(PROJECT_NAME, PROJECT_DIR)
12+
if __name__ == '__main__':
13+
sys.path.insert(0, LIBPATH)
14+
dest_dir = os.path.join(PROJECT_DIR, "build", "sphinx")
15+
if not os.path.isdir(dest_dir):
16+
os.makedirs(dest_dir)
17+
18+
argv = ["-b", "html",
19+
os.path.join(PROJECT_DIR,"doc","source"),
20+
dest_dir ]
21+
print(argv)
22+
sys.exit(main(argv))

0 commit comments

Comments
 (0)