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# Define this variable in case it's not defined by the user.
66# It defaults to `alabaster` which is the default from Sphinx.
67# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_theme
68html_theme = globals().get('html_theme', 'alabaster')
69
70#Add project information to the template context.
71context = {
72 'html_theme': html_theme,
73 'current_version': "test-branch",
74 'version_slug': "test-branch",
75 'MEDIA_URL': "https://media.readthedocs.org/",
76 'STATIC_URL': "https://assets.readthedocs.org/static/",
77 'PRODUCTION_DOMAIN': "readthedocs.org",
78 'proxied_static_path': "/_/static/",
79 'versions': [
80 ("latest", "/en/latest/"),
81 ("stable", "/en/stable/"),
82 ("4.0", "/en/4.0/"),
83 ("2.0", "/en/2.0/"),
84 ("yaml-v2", "/en/yaml-v2/"),
85 ("wormhole", "/en/wormhole/"),
86 ("use-requirements-from-submodule", "/en/use-requirements-from-submodule/"),
87 ("use-py2", "/en/use-py2/"),
88 ("use-apt", "/en/use-apt/"),
89 ("update-conda-startup", "/en/update-conda-startup/"),
90 ("unicode-filename", "/en/unicode-filename/"),
91 ("d--branch", "/en/d--branch/"),
92 ("ubuntu-22.04-python3.x", "/en/ubuntu-22.04-python3.x/"),
93 ("ubuntu-22.04-python3.6", "/en/ubuntu-22.04-python3.6/"),
94 ("ubuntu-22.04-python3.12", "/en/ubuntu-22.04-python3.12/"),
95 ("ubuntu-22.04-python2.7", "/en/ubuntu-22.04-python2.7/"),
96 ("ubuntu-22.04", "/en/ubuntu-22.04/"),
97 ("ubuntu-20.04-python-3.9", "/en/ubuntu-20.04-python-3.9/"),
98 ("ubuntu-20.04", "/en/ubuntu-20.04/"),
99 ("typlog-theme", "/en/typlog-theme/"),
100 ("timetestlarge", "/en/timetestlarge/"),
101 ("timetest", "/en/timetest/"),
102 ("timeout", "/en/timeout/"),
103 ("throw-exception", "/en/throw-exception/"),
104 ("test-ubuntu-20.04", "/en/test-ubuntu-20.04/"),
105 ("test-paths-with-spaces", "/en/test-paths-with-spaces/"),
106 ("test-parent-path-error", "/en/test-parent-path-error/"),
107 ("testing-activate-version", "/en/testing-activate-version/"),
108 ("test-branch", "/en/test-branch/"),
109 ("test-auto-cancel", "/en/test-auto-cancel/"),
110 ("template-config-file", "/en/template-config-file/"),
111 ("sudo-commands", "/en/sudo-commands/"),
112 ("submodule-not-found", "/en/submodule-not-found/"),
113 ("submodule-https-scheme", "/en/submodule-https-scheme/"),
114 ("submodule-git-scheme", "/en/submodule-git-scheme/"),
115 ("staticrypt", "/en/staticrypt/"),
116 ("sphinx-tectonic-pdf", "/en/sphinx-tectonic-pdf/"),
117 ("sphinx-tabs", "/en/sphinx-tabs/"),
118 ("sphinx-multipage-html", "/en/sphinx-multipage-html/"),
119 ("sphinx-mkdocstrings", "/en/sphinx-mkdocstrings/"),
120 ("sphinx-latest", "/en/sphinx-latest/"),
121 ("sphinx-hoverxref", "/en/sphinx-hoverxref/"),
122 ("sphinx.ext.duration", "/en/sphinx.ext.duration/"),
123 ("sphinx-es-suggest", "/en/sphinx-es-suggest/"),
124 ("sphinx-docs-zundler", "/en/sphinx-docs-zundler/"),
125 ("sphinx-conf-nonstandard", "/en/sphinx-conf-nonstandard/"),
126 ("sphinx-awesome", "/en/sphinx-awesome/"),
127 ("sphinx-7.0.x", "/en/sphinx-7.0.x/"),
128 ("sphinx6.x-default", "/en/sphinx6.x-default/"),
129 ("sphinx5.x-default-confpy", "/en/sphinx5.x-default-confpy/"),
130 ("sphinx-5.x", "/en/sphinx-5.x/"),
131 ("sphinx-1.8", "/en/sphinx-1.8/"),
132 ("skip-build-command-pr-test3", "/en/skip-build-command-pr-test3/"),
133 ("skip-build-command-pr-test2", "/en/skip-build-command-pr-test2/"),
134 ("skip-build-command", "/en/skip-build-command/"),
135 ("singlehtml", "/en/singlehtml/"),
136 ("shot-scraper", "/en/shot-scraper/"),
137 ("search-with-old-sphinx-and-theme", "/en/search-with-old-sphinx-and-theme/"),
138 ("search-special-chars", "/en/search-special-chars/"),
139 ("rust-1.70", "/en/rust-1.70/"),
140 ("rust", "/en/rust/"),
141 ("robots-txt", "/en/robots-txt/"),
142 ("requirements-not-found", "/en/requirements-not-found/"),
143 ("regular-404-page", "/en/regular-404-page/"),
144 ("recommonmark", "/en/recommonmark/"),
145 ("readthedocs-docs-build-commands", "/en/readthedocs-docs-build-commands/"),
146 ("python-system-packages", "/en/python-system-packages/"),
147 ("python-setuptools-package", "/en/python-setuptools-package/"),
148 ("pypy3.5", "/en/pypy3.5/"),
149 ("pygments-custom-lexer-apex", "/en/pygments-custom-lexer-apex/"),
150 ("py3.9", "/en/py3.9/"),
151 ("py3.8", "/en/py3.8/"),
152 ("py3.11", "/en/py3.11/"),
153 ("py3.10", "/en/py3.10/"),
154 ("pr-visual-diff", "/en/pr-visual-diff/"),
155 ("pr-test-git-clone-test", "/en/pr-test-git-clone-test/"),
156 ("pr-test", "/en/pr-test/"),
157 ("pr-readthedocs_output", "/en/pr-readthedocs_output/"),
158 ("pr-js-client", "/en/pr-js-client/"),
159 ("pr-homepage-edition", "/en/pr-homepage-edition/"),
160 ("pr-docusaurus", "/en/pr-docusaurus/"),
161 ("poetry-asdf", "/en/poetry-asdf/"),
162 ("poetry", "/en/poetry/"),
163 ("pelican", "/en/pelican/"),
164 ("pdf-rinohtype", "/en/pdf-rinohtype/"),
165 ("pdf-cmd-fail", "/en/pdf-cmd-fail/"),
166 ("pdf-build-jobs", "/en/pdf-build-jobs/"),
167 ("old-output-directory", "/en/old-output-directory/"),
168 ("no-pr-build", "/en/no-pr-build/"),
169 ("no-html-theme-defined", "/en/no-html-theme-defined/"),
170 ("no-conf-py", "/en/no-conf-py/"),
171 ("no-config-file", "/en/no-config-file/"),
172 ("nbsphinx-3d-plot", "/en/nbsphinx-3d-plot/"),
173 ("multiple-source-suffix", "/en/multiple-source-suffix/"),
174 ("monorepo", "/en/monorepo/"),
175 ("mkdocs-python-tags", "/en/mkdocs-python-tags/"),
176 ("mkdocs-pdf", "/en/mkdocs-pdf/"),
177 ("mkdocs-material", "/en/mkdocs-material/"),
178 ("mkdocs-htmlzip", "/en/mkdocs-htmlzip/"),
179 ("mkdocs-config-at-root", "/en/mkdocs-config-at-root/"),
180 ("mkdocs", "/en/mkdocs/"),
181 ("meta-tags", "/en/meta-tags/"),
182 ("manual-integrations", "/en/manual-integrations/"),
183 ("manual-integration-docsify", "/en/manual-integration-docsify/"),
184 ("mamba", "/en/mamba/"),
185 ("jupyter-book", "/en/jupyter-book/"),
186 ("jsdoc-autoapi", "/en/jsdoc-autoapi/"),
187 ("jsdoc", "/en/jsdoc/"),
188 ("japanese-pdf", "/en/japanese-pdf/"),
189 ("invalid-submodules", "/en/invalid-submodules/"),
190 ("invalid-docker-image", "/en/invalid-docker-image/"),
191 ("install-setuptools", "/en/install-setuptools/"),
192 ("humitos-patch-2", "/en/humitos-patch-2/"),
193 ("huge-build-output", "/en/huge-build-output/"),
194 ("htmldir", "/en/htmldir/"),
195 ("git-submodules-invalid", "/en/git-submodules-invalid/"),
196 ("git-submodules", "/en/git-submodules/"),
197 ("git-lfs-build-jobs", "/en/git-lfs-build-jobs/"),
198 ("furo", "/en/furo/"),
199 ("file-with-apostrophe", "/en/file-with-apostrophe/"),
200 ("expose-env-pip-error", "/en/expose-env-pip-error/"),
201 ("explicit-flyout-placement", "/en/explicit-flyout-placement/"),
202 ("envvar-config-file", "/en/envvar-config-file/"),
203 ("environment-variables", "/en/environment-variables/"),
204 ("docusaurus", "/en/docusaurus/"),
205 ("docsify-ads", "/en/docsify-ads/"),
206 ("docsify", "/en/docsify/"),
207 ("docdiff-example", "/en/docdiff-example/"),
208 ("datetime", "/en/datetime/"),
209 ("d2lbook", "/en/d2lbook/"),
210 ("custom-404-page", "/en/custom-404-page/"),
211 ("conda-pin-common-deps", "/en/conda-pin-common-deps/"),
212 ("conda-env-py3.7", "/en/conda-env-py3.7/"),
213 ("conda-env-no-py-pinned", "/en/conda-env-no-py-pinned/"),
214 ("conda-env", "/en/conda-env/"),
215 ("c-dependencies", "/en/c-dependencies/"),
216 ("build-tools-mamba", "/en/build-tools-mamba/"),
217 ("build-tools-conda", "/en/build-tools-conda/"),
218 ("build-tools", "/en/build-tools/"),
219 ("build-os-error-message", "/en/build-os-error-message/"),
220 ("build-latest-python-3.8", "/en/build-latest-python-3.8/"),
221 ("build-jobs-spaces-in-command", "/en/build-jobs-spaces-in-command/"),
222 ("build-jobs-post-build", "/en/build-jobs-post-build/"),
223 ("build-jobs-multiline", "/en/build-jobs-multiline/"),
224 ("build-jobs-diff-exit", "/en/build-jobs-diff-exit/"),
225 ("build-jobs", "/en/build-jobs/"),
226 ("build-internals", "/en/build-internals/"),
227 ("build-image", "/en/build-image/"),
228 ("build-commands-multiline", "/en/build-commands-multiline/"),
229 ("build-commands-env-vars", "/en/build-commands-env-vars/"),
230 ("build-commands", "/en/build-commands/"),
231 ("branch-with-slashes", "/en/branch-with-slashes/"),
232 ("bare-commands", "/en/bare-commands/"),
233 ("asciidoctor", "/en/asciidoctor/"),
234 ("another-matching-branch", "/en/another-matching-branch/"),
235 ("annotated-tag", "/en/annotated-tag/"),
236 ("all-formats-build-jobs", "/en/all-formats-build-jobs/"),
237 ("all-formats-build-commands", "/en/all-formats-build-commands/"),
238 ("all-formats", "/en/all-formats/"),
239 ("alabaster-theme", "/en/alabaster-theme/"),
240 ],
241 'downloads': [
242 ],
243 'subprojects': [
244 ],
245 'slug': 'test-builds',
246 'name': u'test-builds',
247 'rtd_language': u'en',
248 'programming_language': u'words',
249 'canonical_url': '',
250 'analytics_code': 'UA-12341234-1',
251 'single_version': False,
252 'conf_py_path': '/docs/',
253 'api_host': 'https://readthedocs.org',
254 'github_user': 'readthedocs',
255 'proxied_api_host': '/_',
256 'github_repo': 'test-builds',
257 'github_version': 'test-branch',
258 'display_github': True,
259 'bitbucket_user': 'None',
260 'bitbucket_repo': 'None',
261 'bitbucket_version': 'test-branch',
262 'display_bitbucket': False,
263 'gitlab_user': 'None',
264 'gitlab_repo': 'None',
265 'gitlab_version': 'test-branch',
266 'display_gitlab': False,
267 'READTHEDOCS': True,
268 'using_theme': (html_theme == "default"),
269 'new_theme': (html_theme == "sphinx_rtd_theme"),
270 'source_suffix': SUFFIX,
271 'ad_free': False,
272 'docsearch_disabled': False,
273 'user_analytics_code': 'UA-12341234-1',
274 'global_analytics_code': None,
275 'commit': '88245884',
276}
277
278# For sphinx >=1.8 we can use html_baseurl to set the canonical URL.
279# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_baseurl
280if version_info >= (1, 8):
281 if not globals().get('html_baseurl'):
282 html_baseurl = context['canonical_url']
283 context['canonical_url'] = None
284
285
286
287
288
289if 'html_context' in globals():
290 for key in context:
291 if key not in html_context:
292 html_context[key] = context[key]
293else:
294 html_context = context
295
296# Add custom RTD extension
297if 'extensions' in globals():
298 # Insert at the beginning because it can interfere
299 # with other extensions.
300 # See https://github.com/rtfd/readthedocs.org/pull/4054
301 extensions.insert(0, "readthedocs_ext.readthedocs")
302else:
303 extensions = ["readthedocs_ext.readthedocs"]
304
305# Add External version warning banner to the external version documentation
306if 'branch' == 'external':
307 extensions.insert(1, "readthedocs_ext.external_version_warning")
308 readthedocs_vcs_url = 'None'
309 readthedocs_build_url = 'https://readthedocs.org/projects/test-builds/builds/22504403/'
310
311project_language = 'en'
312
313# User's Sphinx configurations
314language_user = globals().get('language', None)
315latex_engine_user = globals().get('latex_engine', None)
316latex_elements_user = globals().get('latex_elements', None)
317
318# Remove this once xindy gets installed in Docker image and XINDYOPS
319# env variable is supported
320# https://github.com/rtfd/readthedocs-docker-images/pull/98
321latex_use_xindy = False
322
323chinese = any([
324 language_user in ('zh_CN', 'zh_TW'),
325 project_language in ('zh_CN', 'zh_TW'),
326])
327
328japanese = any([
329 language_user == 'ja',
330 project_language == 'ja',
331])
332
333if chinese:
334 latex_engine = latex_engine_user or 'xelatex'
335
336 latex_elements_rtd = {
337 'preamble': '\\usepackage[UTF8]{ctex}\n',
338 }
339 latex_elements = latex_elements_user or latex_elements_rtd
340elif japanese:
341 latex_engine = latex_engine_user or 'platex'
342
343# Make sure our build directory is always excluded
344exclude_patterns = globals().get('exclude_patterns', [])
345exclude_patterns.extend(['_build'])