1# -*- coding: utf-8 -*-
2
3# Default settings
4project = 'Test Builds'
5extensions = [
6 'sphinx_autorun',
7]
8
9latex_engine = 'xelatex' # allow us to build Unicode chars
10
11
12# Include all your settings here
13html_theme = 'sphinx_rtd_theme'
14
15
16
17
18###########################################################################
19# auto-created readthedocs.org specific configuration #
20###########################################################################
21
22
23#
24# The following code was added during an automated build on readthedocs.org
25# It is auto created and injected for every build. The result is based on the
26# conf.py.tmpl file found in the readthedocs.org codebase:
27# https://github.com/rtfd/readthedocs.org/blob/main/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl
28#
29# Note: this file shouldn't rely on extra dependencies.
30
31import importlib
32import sys
33import os.path
34
35# Borrowed from six.
36PY3 = sys.version_info[0] == 3
37string_types = str if PY3 else basestring
38
39from sphinx import version_info
40
41# Get suffix for proper linking to GitHub
42# This is deprecated in Sphinx 1.3+,
43# as each page can have its own suffix
44if globals().get('source_suffix', False):
45 if isinstance(source_suffix, string_types):
46 SUFFIX = source_suffix
47 elif isinstance(source_suffix, (list, tuple)):
48 # Sphinx >= 1.3 supports list/tuple to define multiple suffixes
49 SUFFIX = source_suffix[0]
50 elif isinstance(source_suffix, dict):
51 # Sphinx >= 1.8 supports a mapping dictionary for multiple suffixes
52 SUFFIX = list(source_suffix.keys())[0] # make a ``list()`` for py2/py3 compatibility
53 else:
54 # default to .rst
55 SUFFIX = '.rst'
56else:
57 SUFFIX = '.rst'
58
59# Add RTD Static Path. Add to the end because it overwrites previous files.
60if not 'html_static_path' in globals():
61 html_static_path = []
62if os.path.exists('_static'):
63 html_static_path.append('_static')
64
65# Add RTD Theme only if they aren't overriding it already
66using_rtd_theme = (
67 (
68 'html_theme' in globals() and
69 html_theme in ['default'] and
70 # Allow people to bail with a hack of having an html_style
71 'html_style' not in globals()
72 ) or 'html_theme' not in globals()
73)
74if using_rtd_theme:
75 html_theme = 'sphinx_rtd_theme'
76 html_style = None
77 html_theme_options = {}
78
79
80# This following legacy behavior will gradually be sliced out until its deprecated and removed.
81# Skipped for Sphinx 6+
82# Skipped by internal Feature flag SKIP_SPHINX_HTML_THEME_PATH
83# Skipped by all new projects since SKIP_SPHINX_HTML_THEME_PATH's introduction (jan 2023)
84if (
85 using_rtd_theme
86 and version_info < (6,0)
87 and not False
88 ):
89 theme = importlib.import_module('sphinx_rtd_theme')
90 if 'html_theme_path' in globals():
91 html_theme_path.append(theme.get_html_theme_path())
92 else:
93 html_theme_path = [theme.get_html_theme_path()]
94
95# Define websupport2_base_url and websupport2_static_url
96if globals().get('websupport2_base_url', False):
97 websupport2_base_url = 'https://readthedocs.org/websupport'
98 websupport2_static_url = 'https://assets.readthedocs.org/static/'
99
100
101#Add project information to the template context.
102context = {
103 'using_theme': using_rtd_theme,
104 'html_theme': html_theme,
105 'current_version': "latest",
106 'version_slug': "latest",
107 'MEDIA_URL': "https://media.readthedocs.org/",
108 'STATIC_URL': "https://assets.readthedocs.org/static/",
109 'PRODUCTION_DOMAIN': "readthedocs.org",
110 'proxied_static_path': "/_/static/",
111 'versions': [
112 ("latest", "/en/latest/"),
113 ("stable", "/en/stable/"),
114 ("4.0", "/en/4.0/"),
115 ("2.0", "/en/2.0/"),
116 ("yaml-v2", "/en/yaml-v2/"),
117 ("wormhole", "/en/wormhole/"),
118 ("use-requirements-from-submodule", "/en/use-requirements-from-submodule/"),
119 ("use-py2", "/en/use-py2/"),
120 ("use-apt", "/en/use-apt/"),
121 ("unicode-filename", "/en/unicode-filename/"),
122 ("d--branch", "/en/d--branch/"),
123 ("ubuntu-22.04", "/en/ubuntu-22.04/"),
124 ("ubuntu-20.04-python-3.9", "/en/ubuntu-20.04-python-3.9/"),
125 ("ubuntu-20.04", "/en/ubuntu-20.04/"),
126 ("typlog-theme", "/en/typlog-theme/"),
127 ("timetestlarge", "/en/timetestlarge/"),
128 ("timetest", "/en/timetest/"),
129 ("timeout", "/en/timeout/"),
130 ("throw-exception", "/en/throw-exception/"),
131 ("test-ubuntu-20.04", "/en/test-ubuntu-20.04/"),
132 ("test-paths-with-spaces", "/en/test-paths-with-spaces/"),
133 ("testing-activate-version", "/en/testing-activate-version/"),
134 ("test-auto-cancel", "/en/test-auto-cancel/"),
135 ("template-config-file", "/en/template-config-file/"),
136 ("sudo-commands", "/en/sudo-commands/"),
137 ("submodule-not-found", "/en/submodule-not-found/"),
138 ("submodule-https-scheme", "/en/submodule-https-scheme/"),
139 ("submodule-git-scheme", "/en/submodule-git-scheme/"),
140 ("staticrypt", "/en/staticrypt/"),
141 ("sphinx-tectonic-pdf", "/en/sphinx-tectonic-pdf/"),
142 ("sphinx-tabs", "/en/sphinx-tabs/"),
143 ("sphinx-multipage-html", "/en/sphinx-multipage-html/"),
144 ("sphinx-mkdocstrings", "/en/sphinx-mkdocstrings/"),
145 ("sphinx-latest", "/en/sphinx-latest/"),
146 ("sphinx-hoverxref", "/en/sphinx-hoverxref/"),
147 ("sphinx.ext.duration", "/en/sphinx.ext.duration/"),
148 ("sphinx-es-suggest", "/en/sphinx-es-suggest/"),
149 ("sphinx-docs-zundler", "/en/sphinx-docs-zundler/"),
150 ("sphinx-conf-nonstandard", "/en/sphinx-conf-nonstandard/"),
151 ("sphinx-7.0.x", "/en/sphinx-7.0.x/"),
152 ("sphinx6.x-default", "/en/sphinx6.x-default/"),
153 ("sphinx5.x-default-confpy", "/en/sphinx5.x-default-confpy/"),
154 ("sphinx-5.x", "/en/sphinx-5.x/"),
155 ("skip-build-command-pr-test3", "/en/skip-build-command-pr-test3/"),
156 ("skip-build-command-pr-test2", "/en/skip-build-command-pr-test2/"),
157 ("skip-build-command-pr-test", "/en/skip-build-command-pr-test/"),
158 ("skip-build-command", "/en/skip-build-command/"),
159 ("singlehtml", "/en/singlehtml/"),
160 ("shot-scraper", "/en/shot-scraper/"),
161 ("search-with-old-sphinx-and-theme", "/en/search-with-old-sphinx-and-theme/"),
162 ("search-special-chars", "/en/search-special-chars/"),
163 ("rust", "/en/rust/"),
164 ("robots-txt", "/en/robots-txt/"),
165 ("requirements-not-found", "/en/requirements-not-found/"),
166 ("regular-404-page", "/en/regular-404-page/"),
167 ("recommonmark", "/en/recommonmark/"),
168 ("readthedocs-docs-build-commands", "/en/readthedocs-docs-build-commands/"),
169 ("pypy3.5", "/en/pypy3.5/"),
170 ("pygments-custom-lexer-apex", "/en/pygments-custom-lexer-apex/"),
171 ("py3.9", "/en/py3.9/"),
172 ("py3.8", "/en/py3.8/"),
173 ("py3.11", "/en/py3.11/"),
174 ("py3.10", "/en/py3.10/"),
175 ("pr-visual-diff", "/en/pr-visual-diff/"),
176 ("pr-test", "/en/pr-test/"),
177 ("pr-js-client", "/en/pr-js-client/"),
178 ("pr-homepage-edition", "/en/pr-homepage-edition/"),
179 ("poetry-asdf", "/en/poetry-asdf/"),
180 ("poetry", "/en/poetry/"),
181 ("pelican", "/en/pelican/"),
182 ("pdf-rinohtype", "/en/pdf-rinohtype/"),
183 ("pdf-cmd-fail", "/en/pdf-cmd-fail/"),
184 ("path-with-plus", "/en/path-with-plus/"),
185 ("old-output-directory", "/en/old-output-directory/"),
186 ("no-conf-py", "/en/no-conf-py/"),
187 ("no-config-file", "/en/no-config-file/"),
188 ("nbsphinx-3d-plot", "/en/nbsphinx-3d-plot/"),
189 ("multiple-source-suffix", "/en/multiple-source-suffix/"),
190 ("monorepo", "/en/monorepo/"),
191 ("mkdocs-python-tags", "/en/mkdocs-python-tags/"),
192 ("mkdocs-pdf", "/en/mkdocs-pdf/"),
193 ("mkdocs-material", "/en/mkdocs-material/"),
194 ("mkdocs-htmlzip", "/en/mkdocs-htmlzip/"),
195 ("mkdocs-config-at-root", "/en/mkdocs-config-at-root/"),
196 ("mkdocs", "/en/mkdocs/"),
197 ("meta-tags", "/en/meta-tags/"),
198 ("manual-integrations", "/en/manual-integrations/"),
199 ("manual-integration-docsify", "/en/manual-integration-docsify/"),
200 ("mamba", "/en/mamba/"),
201 ("jupyter-book", "/en/jupyter-book/"),
202 ("jsdoc-autoapi", "/en/jsdoc-autoapi/"),
203 ("jsdoc", "/en/jsdoc/"),
204 ("japanese-pdf", "/en/japanese-pdf/"),
205 ("invalid-submodules", "/en/invalid-submodules/"),
206 ("invalid-docker-image", "/en/invalid-docker-image/"),
207 ("install-setuptools", "/en/install-setuptools/"),
208 ("huge-build-output", "/en/huge-build-output/"),
209 ("htmldir", "/en/htmldir/"),
210 ("git-submodules-invalid", "/en/git-submodules-invalid/"),
211 ("git-submodules", "/en/git-submodules/"),
212 ("git-lfs-build-jobs", "/en/git-lfs-build-jobs/"),
213 ("furo", "/en/furo/"),
214 ("file-with-apostrophe", "/en/file-with-apostrophe/"),
215 ("expose-env-pip-error", "/en/expose-env-pip-error/"),
216 ("explicit-flyout-placement", "/en/explicit-flyout-placement/"),
217 ("envvar-config-file", "/en/envvar-config-file/"),
218 ("environment-variables", "/en/environment-variables/"),
219 ("docusaurus", "/en/docusaurus/"),
220 ("docsify-ads", "/en/docsify-ads/"),
221 ("docsify", "/en/docsify/"),
222 ("datetime", "/en/datetime/"),
223 ("d2lbook", "/en/d2lbook/"),
224 ("custom-404-page", "/en/custom-404-page/"),
225 ("conda-pin-common-deps", "/en/conda-pin-common-deps/"),
226 ("conda-env-py3.7", "/en/conda-env-py3.7/"),
227 ("conda-env-no-py-pinned", "/en/conda-env-no-py-pinned/"),
228 ("conda-env", "/en/conda-env/"),
229 ("c-dependencies", "/en/c-dependencies/"),
230 ("build-tools-mamba", "/en/build-tools-mamba/"),
231 ("build-tools-conda", "/en/build-tools-conda/"),
232 ("build-tools", "/en/build-tools/"),
233 ("build-os-error-message", "/en/build-os-error-message/"),
234 ("build-latest-python-3.8", "/en/build-latest-python-3.8/"),
235 ("build-jobs-spaces-in-command", "/en/build-jobs-spaces-in-command/"),
236 ("build-jobs-post-build", "/en/build-jobs-post-build/"),
237 ("build-jobs-multiline", "/en/build-jobs-multiline/"),
238 ("build-jobs-diff-exit", "/en/build-jobs-diff-exit/"),
239 ("build-jobs", "/en/build-jobs/"),
240 ("build-internals", "/en/build-internals/"),
241 ("build-commands-multiline", "/en/build-commands-multiline/"),
242 ("build-commands-env-vars", "/en/build-commands-env-vars/"),
243 ("build-commands", "/en/build-commands/"),
244 ("branch-with-slashes", "/en/branch-with-slashes/"),
245 ("bare-commands", "/en/bare-commands/"),
246 ("another-matching-branch", "/en/another-matching-branch/"),
247 ("annotated-tag", "/en/annotated-tag/"),
248 ("all-formats-build-jobs", "/en/all-formats-build-jobs/"),
249 ("all-formats-build-commands", "/en/all-formats-build-commands/"),
250 ("all-formats", "/en/all-formats/"),
251 ("alabaster-theme", "/en/alabaster-theme/"),
252 ],
253 'downloads': [
254 ],
255 'subprojects': [
256 ],
257 'slug': 'test-builds',
258 'name': u'test-builds',
259 'rtd_language': u'en',
260 'programming_language': u'words',
261 'canonical_url': 'https://test-builds.readthedocs.io/en/latest/',
262 'analytics_code': 'UA-12341234-1',
263 'single_version': False,
264 'conf_py_path': '/docs/',
265 'api_host': 'https://readthedocs.org',
266 'github_user': 'readthedocs',
267 'proxied_api_host': '/_',
268 'github_repo': 'test-builds',
269 'github_version': 'master',
270 'display_github': True,
271 'bitbucket_user': 'None',
272 'bitbucket_repo': 'None',
273 'bitbucket_version': 'master',
274 'display_bitbucket': False,
275 'gitlab_user': 'None',
276 'gitlab_repo': 'None',
277 'gitlab_version': 'master',
278 'display_gitlab': False,
279 'READTHEDOCS': True,
280 'using_theme': (html_theme == "default"),
281 'new_theme': (html_theme == "sphinx_rtd_theme"),
282 'source_suffix': SUFFIX,
283 'ad_free': False,
284 'docsearch_disabled': False,
285 'user_analytics_code': 'UA-12341234-1',
286 'global_analytics_code': None,
287 'commit': '70ff6770',
288}
289
290# For sphinx >=1.8 we can use html_baseurl to set the canonical URL.
291# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_baseurl
292if version_info >= (1, 8):
293 if not globals().get('html_baseurl'):
294 html_baseurl = context['canonical_url']
295 context['canonical_url'] = None
296
297
298
299
300
301if 'html_context' in globals():
302
303 for key in context:
304 if key not in html_context:
305 html_context[key] = context[key]
306
307else:
308 html_context = context
309
310# Add custom RTD extension
311if 'extensions' in globals():
312 # Insert at the beginning because it can interfere
313 # with other extensions.
314 # See https://github.com/rtfd/readthedocs.org/pull/4054
315 extensions.insert(0, "readthedocs_ext.readthedocs")
316else:
317 extensions = ["readthedocs_ext.readthedocs"]
318
319# Add External version warning banner to the external version documentation
320if 'branch' == 'external':
321 extensions.insert(1, "readthedocs_ext.external_version_warning")
322 readthedocs_vcs_url = 'None'
323 readthedocs_build_url = 'https://readthedocs.org/projects/test-builds/builds/20936809/'
324
325project_language = 'en'
326
327# User's Sphinx configurations
328language_user = globals().get('language', None)
329latex_engine_user = globals().get('latex_engine', None)
330latex_elements_user = globals().get('latex_elements', None)
331
332# Remove this once xindy gets installed in Docker image and XINDYOPS
333# env variable is supported
334# https://github.com/rtfd/readthedocs-docker-images/pull/98
335latex_use_xindy = False
336
337chinese = any([
338 language_user in ('zh_CN', 'zh_TW'),
339 project_language in ('zh_CN', 'zh_TW'),
340])
341
342japanese = any([
343 language_user == 'ja',
344 project_language == 'ja',
345])
346
347if chinese:
348 latex_engine = latex_engine_user or 'xelatex'
349
350 latex_elements_rtd = {
351 'preamble': '\\usepackage[UTF8]{ctex}\n',
352 }
353 latex_elements = latex_elements_user or latex_elements_rtd
354elif japanese:
355 latex_engine = latex_engine_user or 'platex'
356
357# Make sure our build directory is always excluded
358exclude_patterns = globals().get('exclude_patterns', [])
359exclude_patterns.extend(['_build'])