-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.py
33 lines (25 loc) · 998 Bytes
/
conf.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2019-2023 releng-tool
from runpy import run_path
import os
import sys
if 'RELENG_TARGET_DIR' not in os.environ:
raise SyntaxError('target directory not provided')
releng_tool_dir = os.path.abspath(os.environ['RELENG_TARGET_DIR'])
releng_tool_doc_dir = os.path.join(releng_tool_dir, 'Documentation')
# inject releng-tool into system path to allow autodocs content to render
sys.path.insert(0, releng_tool_dir)
# load releng-tool's sphinx configuration
conf = os.path.join(releng_tool_doc_dir, 'conf.py')
new_globals = run_path(conf, init_globals=globals())
globals().update(new_globals)
# localization options
if 'RELENG_LOCALE_DIR' not in os.environ:
raise SyntaxError('locale directory not provided')
locale_dirs = [os.environ['RELENG_LOCALE_DIR']]
gettext_compact = False
def setup(app):
# point application documentation to releng-tool's set
app.confdir = releng_tool_doc_dir
app.srcdir = releng_tool_doc_dir