conf.py

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