-
Notifications
You must be signed in to change notification settings - Fork 691
/
conf.py
136 lines (95 loc) · 3.29 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
"""Mopidy documentation build configuration file"""
import os
from importlib.metadata import version
# -- Custom Sphinx setup ------------------------------------------------------
def setup(app):
# Add custom Sphinx object type for Mopidy's config values
app.add_object_type(
"confval",
"confval",
objname="configuration value",
indextemplate="pair: %s; configuration value",
)
# -- General configuration ----------------------------------------------------
needs_sphinx = "5.3"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.extlinks",
"sphinx.ext.graphviz",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
"sphinx_rtd_theme",
]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = "Mopidy"
copyright = "2009-2024, Stein Magnus Jodal and contributors" # noqa: A001
release = version("Mopidy")
version = ".".join(release.split(".")[:2])
# To make the build reproducible, avoid using today's date in the manpages
today = "2024"
exclude_trees = ["_build"]
pygments_style = "sphinx"
modindex_common_prefix = ["mopidy."]
# -- Options for HTML output --------------------------------------------------
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_use_modindex = True
html_use_index = True
html_split_index = False
html_show_sourcelink = True
htmlhelp_basename = "Mopidy"
# Set canonical URL from the Read the Docs Domain
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
# -- Options for LaTeX output -------------------------------------------------
latex_documents = [
(
"index",
"Mopidy.tex",
"Mopidy Documentation",
"Stein Magnus Jodal and contributors",
"manual",
),
]
# -- Options for manpages output ----------------------------------------------
man_pages = [
("command", "mopidy", "music server", "", "1"),
]
# -- Options for autodoc extension --------------------------------------------
autodoc_mock_imports = [
"dbus",
"mopidy.internal.gi",
]
typehints_document_rtype = True
typehints_use_signature = False
typehints_use_signature_return = True
# -- Options for extlink extension --------------------------------------------
extlinks = {
"issue": ("https://github.com/mopidy/mopidy/issues/%s", "#%s"),
"commit": ("https://github.com/mopidy/mopidy/commit/%s", "commit %s"),
"js": ("https://github.com/mopidy/mopidy.js/issues/%s", "mopidy.js#%s"),
"mpris": (
"https://github.com/mopidy/mopidy-mpris/issues/%s",
"mopidy-mpris#%s",
),
"discuss": (
"https://discourse.mopidy.com/t/%s",
"discourse.mopidy.com/t/%s",
),
}
# -- Options for intersphinx extension ----------------------------------------
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"pykka": ("https://pykka.readthedocs.io/en/latest/", None),
"tornado": ("https://www.tornadoweb.org/en/stable/", None),
}
# -- Options for linkcheck builder -------------------------------------------
linkcheck_ignore = [ # Some sites work in browser but linkcheck fails.
r"http://localhost:\d+/",
r"http://wiki.commonjs.org",
r"http://vk.com",
r"http://$",
]
linkcheck_anchors = False # This breaks on links that use # for other stuff