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