-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconf.py
More file actions
47 lines (39 loc) · 1.25 KB
/
conf.py
File metadata and controls
47 lines (39 loc) · 1.25 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
"""Sphinx configuration for g."""
from __future__ import annotations
import pathlib
import sys
from gp_sphinx.config import make_linkcode_resolve, merge_sphinx_config
import g
# Get the project root dir, which is the parent dir of this
cwd = pathlib.Path(__file__).parent
project_root = cwd.parent
src_root = project_root / "src"
sys.path.insert(0, str(src_root))
# package data
about: dict[str, str] = {}
with (src_root / "g" / "__about__.py").open() as fp:
exec(fp.read(), about)
conf = merge_sphinx_config(
project=about["__title__"],
version=about["__version__"],
copyright=about["__copyright__"],
source_repository=f"{about['__github__']}/",
docs_url=about["__docs__"],
source_branch="master",
light_logo="img/g.svg",
dark_logo="img/g-dark.svg",
extra_extensions=[
"sphinx_autodoc_api_style",
"sphinx.ext.todo",
"sphinx_autodoc_argparse.exemplar",
],
intersphinx_mapping={
"py": ("https://docs.python.org/", None),
"libvcs": ("http://libvcs.git-pull.com/", None),
},
linkcode_resolve=make_linkcode_resolve(g, about["__github__"]),
html_favicon="_static/favicon.ico",
html_extra_path=["manifest.json"],
rediraffe_redirects="redirects.txt",
)
globals().update(conf)