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