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