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': "ubuntu-22.04",
106 'version_slug': "ubuntu-22.04",
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-git-clone-test", "/en/pr-test-git-clone-test/"),
177 ("pr-test", "/en/pr-test/"),
178 ("pr-readthedocs_output", "/en/pr-readthedocs_output/"),
179 ("pr-js-client", "/en/pr-js-client/"),
180 ("pr-homepage-edition", "/en/pr-homepage-edition/"),
181 ("pr-docusaurus", "/en/pr-docusaurus/"),
182 ("poetry-asdf", "/en/poetry-asdf/"),
183 ("poetry", "/en/poetry/"),
184 ("pelican", "/en/pelican/"),
185 ("pdf-rinohtype", "/en/pdf-rinohtype/"),
186 ("pdf-cmd-fail", "/en/pdf-cmd-fail/"),
187 ("path-with-plus", "/en/path-with-plus/"),
188 ("old-output-directory", "/en/old-output-directory/"),
189 ("no-pr-build", "/en/no-pr-build/"),
190 ("no-conf-py", "/en/no-conf-py/"),
191 ("no-config-file", "/en/no-config-file/"),
192 ("nbsphinx-3d-plot", "/en/nbsphinx-3d-plot/"),
193 ("multiple-source-suffix", "/en/multiple-source-suffix/"),
194 ("monorepo", "/en/monorepo/"),
195 ("mkdocs-python-tags", "/en/mkdocs-python-tags/"),
196 ("mkdocs-pdf", "/en/mkdocs-pdf/"),
197 ("mkdocs-material", "/en/mkdocs-material/"),
198 ("mkdocs-htmlzip", "/en/mkdocs-htmlzip/"),
199 ("mkdocs-config-at-root", "/en/mkdocs-config-at-root/"),
200 ("mkdocs", "/en/mkdocs/"),
201 ("meta-tags", "/en/meta-tags/"),
202 ("manual-integrations", "/en/manual-integrations/"),
203 ("manual-integration-docsify", "/en/manual-integration-docsify/"),
204 ("mamba", "/en/mamba/"),
205 ("jupyter-book", "/en/jupyter-book/"),
206 ("jsdoc-autoapi", "/en/jsdoc-autoapi/"),
207 ("jsdoc", "/en/jsdoc/"),
208 ("japanese-pdf", "/en/japanese-pdf/"),
209 ("invalid-submodules", "/en/invalid-submodules/"),
210 ("invalid-docker-image", "/en/invalid-docker-image/"),
211 ("install-setuptools", "/en/install-setuptools/"),
212 ("huge-build-output", "/en/huge-build-output/"),
213 ("htmldir", "/en/htmldir/"),
214 ("git-submodules-invalid", "/en/git-submodules-invalid/"),
215 ("git-submodules", "/en/git-submodules/"),
216 ("git-lfs-build-jobs", "/en/git-lfs-build-jobs/"),
217 ("furo", "/en/furo/"),
218 ("file-with-apostrophe", "/en/file-with-apostrophe/"),
219 ("expose-env-pip-error", "/en/expose-env-pip-error/"),
220 ("explicit-flyout-placement", "/en/explicit-flyout-placement/"),
221 ("envvar-config-file", "/en/envvar-config-file/"),
222 ("environment-variables", "/en/environment-variables/"),
223 ("docusaurus", "/en/docusaurus/"),
224 ("docsify-ads", "/en/docsify-ads/"),
225 ("docsify", "/en/docsify/"),
226 ("datetime", "/en/datetime/"),
227 ("d2lbook", "/en/d2lbook/"),
228 ("custom-404-page", "/en/custom-404-page/"),
229 ("conda-pin-common-deps", "/en/conda-pin-common-deps/"),
230 ("conda-env-py3.7", "/en/conda-env-py3.7/"),
231 ("conda-env-no-py-pinned", "/en/conda-env-no-py-pinned/"),
232 ("conda-env", "/en/conda-env/"),
233 ("c-dependencies", "/en/c-dependencies/"),
234 ("build-tools-mamba", "/en/build-tools-mamba/"),
235 ("build-tools-conda", "/en/build-tools-conda/"),
236 ("build-tools", "/en/build-tools/"),
237 ("build-os-error-message", "/en/build-os-error-message/"),
238 ("build-latest-python-3.8", "/en/build-latest-python-3.8/"),
239 ("build-jobs-spaces-in-command", "/en/build-jobs-spaces-in-command/"),
240 ("build-jobs-post-build", "/en/build-jobs-post-build/"),
241 ("build-jobs-multiline", "/en/build-jobs-multiline/"),
242 ("build-jobs-diff-exit", "/en/build-jobs-diff-exit/"),
243 ("build-jobs", "/en/build-jobs/"),
244 ("build-internals", "/en/build-internals/"),
245 ("build-commands-multiline", "/en/build-commands-multiline/"),
246 ("build-commands-env-vars", "/en/build-commands-env-vars/"),
247 ("build-commands", "/en/build-commands/"),
248 ("branch-with-slashes", "/en/branch-with-slashes/"),
249 ("bare-commands", "/en/bare-commands/"),
250 ("another-matching-branch", "/en/another-matching-branch/"),
251 ("annotated-tag", "/en/annotated-tag/"),
252 ("all-formats-build-jobs", "/en/all-formats-build-jobs/"),
253 ("all-formats-build-commands", "/en/all-formats-build-commands/"),
254 ("all-formats", "/en/all-formats/"),
255 ("alabaster-theme", "/en/alabaster-theme/"),
256 ],
257 'downloads': [
258 ],
259 'subprojects': [
260 ],
261 'slug': 'test-builds',
262 'name': u'test-builds',
263 'rtd_language': u'en',
264 'programming_language': u'words',
265 'canonical_url': '',
266 'analytics_code': 'UA-12341234-1',
267 'single_version': False,
268 'conf_py_path': '/docs/',
269 'api_host': 'https://readthedocs.org',
270 'github_user': 'readthedocs',
271 'proxied_api_host': '/_',
272 'github_repo': 'test-builds',
273 'github_version': 'ubuntu-22.04',
274 'display_github': True,
275 'bitbucket_user': 'None',
276 'bitbucket_repo': 'None',
277 'bitbucket_version': 'ubuntu-22.04',
278 'display_bitbucket': False,
279 'gitlab_user': 'None',
280 'gitlab_repo': 'None',
281 'gitlab_version': 'ubuntu-22.04',
282 'display_gitlab': False,
283 'READTHEDOCS': True,
284 'using_theme': (html_theme == "default"),
285 'new_theme': (html_theme == "sphinx_rtd_theme"),
286 'source_suffix': SUFFIX,
287 'ad_free': False,
288 'docsearch_disabled': False,
289 'user_analytics_code': 'UA-12341234-1',
290 'global_analytics_code': None,
291 'commit': 'a211d26a',
292}
293
294# For sphinx >=1.8 we can use html_baseurl to set the canonical URL.
295# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_baseurl
296if version_info >= (1, 8):
297 if not globals().get('html_baseurl'):
298 html_baseurl = context['canonical_url']
299 context['canonical_url'] = None
300
301
302
303
304
305if 'html_context' in globals():
306 for key in context:
307 if key not in html_context:
308 html_context[key] = context[key]
309else:
310 html_context = context
311
312# Add custom RTD extension
313if 'extensions' in globals():
314 # Insert at the beginning because it can interfere
315 # with other extensions.
316 # See https://github.com/rtfd/readthedocs.org/pull/4054
317 extensions.insert(0, "readthedocs_ext.readthedocs")
318else:
319 extensions = ["readthedocs_ext.readthedocs"]
320
321# Add External version warning banner to the external version documentation
322if 'branch' == 'external':
323 extensions.insert(1, "readthedocs_ext.external_version_warning")
324 readthedocs_vcs_url = 'None'
325 readthedocs_build_url = 'https://readthedocs.org/projects/test-builds/builds/21135445/'
326
327project_language = 'en'
328
329# User's Sphinx configurations
330language_user = globals().get('language', None)
331latex_engine_user = globals().get('latex_engine', None)
332latex_elements_user = globals().get('latex_elements', None)
333
334# Remove this once xindy gets installed in Docker image and XINDYOPS
335# env variable is supported
336# https://github.com/rtfd/readthedocs-docker-images/pull/98
337latex_use_xindy = False
338
339chinese = any([
340 language_user in ('zh_CN', 'zh_TW'),
341 project_language in ('zh_CN', 'zh_TW'),
342])
343
344japanese = any([
345 language_user == 'ja',
346 project_language == 'ja',
347])
348
349if chinese:
350 latex_engine = latex_engine_user or 'xelatex'
351
352 latex_elements_rtd = {
353 'preamble': '\\usepackage[UTF8]{ctex}\n',
354 }
355 latex_elements = latex_elements_user or latex_elements_rtd
356elif japanese:
357 latex_engine = latex_engine_user or 'platex'
358
359# Make sure our build directory is always excluded
360exclude_patterns = globals().get('exclude_patterns', [])
361exclude_patterns.extend(['_build'])