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 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': "python-system-packages",
106    'version_slug': "python-system-packages",
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", "/es/latest/"),
113    ("stable", "/es/stable/"),
114    ("5.0", "/es/5.0/"),
115    ("4.0", "/es/4.0/"),
116    ("wormhole", "/es/wormhole/"),
117    ("update-conda-startup", "/es/update-conda-startup/"),
118    ("ubuntu-22.04", "/es/ubuntu-22.04/"),
119    ("ubuntu-20.04-python-3.9", "/es/ubuntu-20.04-python-3.9/"),
120    ("ubuntu-20.04", "/es/ubuntu-20.04/"),
121    ("theme-1.0rc1", "/es/theme-1.0rc1/"),
122    ("test-ubuntu-20.04", "/es/test-ubuntu-20.04/"),
123    ("test-rebased-commit", "/es/test-rebased-commit/"),
124    ("test-parent-path-error", "/es/test-parent-path-error/"),
125    ("test-auto-cancel", "/es/test-auto-cancel/"),
126    ("template-config-file", "/es/template-config-file/"),
127    ("symlink-via-zipfile", "/es/symlink-via-zipfile/"),
128    ("sudo-commands", "/es/sudo-commands/"),
129    ("submodule-not-found", "/es/submodule-not-found/"),
130    ("staticrypt", "/es/staticrypt/"),
131    ("sphinx-tectonic-pdf", "/es/sphinx-tectonic-pdf/"),
132    ("sphinx-multipage-html", "/es/sphinx-multipage-html/"),
133    ("sphinx-mkdocstrings", "/es/sphinx-mkdocstrings/"),
134    ("sphinx-hoverxref", "/es/sphinx-hoverxref/"),
135    ("sphinx-fork", "/es/sphinx-fork/"),
136    ("sphinx-docs-zundler", "/es/sphinx-docs-zundler/"),
137    ("sphinx-conf-nonstandard", "/es/sphinx-conf-nonstandard/"),
138    ("sphinx-awesome", "/es/sphinx-awesome/"),
139    ("sphinx-7.0.x", "/es/sphinx-7.0.x/"),
140    ("sphinx6.x-default", "/es/sphinx6.x-default/"),
141    ("sphinx5.x-default-confpy", "/es/sphinx5.x-default-confpy/"),
142    ("sphinx-5.x", "/es/sphinx-5.x/"),
143    ("sphinx-1.8", "/es/sphinx-1.8/"),
144    ("sphinx-1.7", "/es/sphinx-1.7/"),
145    ("sphinx-1.6", "/es/sphinx-1.6/"),
146    ("skip-build-command-pr-test3", "/es/skip-build-command-pr-test3/"),
147    ("skip-build-command-pr-test2", "/es/skip-build-command-pr-test2/"),
148    ("skip-build-command-pr-test", "/es/skip-build-command-pr-test/"),
149    ("skip-build-command", "/es/skip-build-command/"),
150    ("singlehtml", "/es/singlehtml/"),
151    ("shot-scraper", "/es/shot-scraper/"),
152    ("search-special-chars", "/es/search-special-chars/"),
153    ("rust-1.70", "/es/rust-1.70/"),
154    ("rust", "/es/rust/"),
155    ("rtd-sphinx-ext", "/es/rtd-sphinx-ext/"),
156    ("robots-txt", "/es/robots-txt/"),
157    ("regular-404-page", "/es/regular-404-page/"),
158    ("recommonmark", "/es/recommonmark/"),
159    ("readthedocs-docs-build-commands", "/es/readthedocs-docs-build-commands/"),
160    ("python-system-packages", "/es/python-system-packages/"),
161    ("python-setuptools-package", "/es/python-setuptools-package/"),
162    ("py3.11a", "/es/py3.11a/"),
163    ("py3.11", "/es/py3.11/"),
164    ("py3.10", "/es/py3.10/"),
165    ("pr-visual-diff", "/es/pr-visual-diff/"),
166    ("pr-test-git-clone-test", "/es/pr-test-git-clone-test/"),
167    ("pr-test", "/es/pr-test/"),
168    ("pr-readthedocs_output", "/es/pr-readthedocs_output/"),
169    ("pr-js-client", "/es/pr-js-client/"),
170    ("pr-homepage-edition", "/es/pr-homepage-edition/"),
171    ("pr-docusaurus", "/es/pr-docusaurus/"),
172    ("poetry-asdf", "/es/poetry-asdf/"),
173    ("poetry", "/es/poetry/"),
174    ("pelican", "/es/pelican/"),
175    ("pdf-rinohtype", "/es/pdf-rinohtype/"),
176    ("pdf-multiple", "/es/pdf-multiple/"),
177    ("pdf-cmd-fail", "/es/pdf-cmd-fail/"),
178    ("ooops-all-json", "/es/ooops-all-json/"),
179    ("old-output-directory", "/es/old-output-directory/"),
180    ("no-pr-build", "/es/no-pr-build/"),
181    ("no-conf-py", "/es/no-conf-py/"),
182    ("no-config-file", "/es/no-config-file/"),
183    ("monorepo", "/es/monorepo/"),
184    ("mkdocs-pdf", "/es/mkdocs-pdf/"),
185    ("mkdocs-material", "/es/mkdocs-material/"),
186    ("mkdocs-htmlzip", "/es/mkdocs-htmlzip/"),
187    ("mkdocs-config-at-root", "/es/mkdocs-config-at-root/"),
188    ("mkdocs", "/es/mkdocs/"),
189    ("manual-integrations", "/es/manual-integrations/"),
190    ("manual-integration-docsify", "/es/manual-integration-docsify/"),
191    ("mamba", "/es/mamba/"),
192    ("main", "/es/main/"),
193    ("linkcheck", "/es/linkcheck/"),
194    ("jupyter-notebook", "/es/jupyter-notebook/"),
195    ("jupyter-book", "/es/jupyter-book/"),
196    ("jsdoc-autoapi", "/es/jsdoc-autoapi/"),
197    ("jsdoc", "/es/jsdoc/"),
198    ("invalid-docker-image", "/es/invalid-docker-image/"),
199    ("install-setuptools", "/es/install-setuptools/"),
200    ("image", "/es/image/"),
201    ("humitos-poetry", "/es/humitos-poetry/"),
202    ("git-submodules-invalid", "/es/git-submodules-invalid/"),
203    ("git-submodules", "/es/git-submodules/"),
204    ("git-lfs-build-jobs", "/es/git-lfs-build-jobs/"),
205    ("furo", "/es/furo/"),
206    ("expose-env-pip-error", "/es/expose-env-pip-error/"),
207    ("explicit-flyout-placement", "/es/explicit-flyout-placement/"),
208    ("expirement", "/es/expirement/"),
209    ("envvar-config-file", "/es/envvar-config-file/"),
210    ("docusaurus", "/es/docusaurus/"),
211    ("docsify-ads", "/es/docsify-ads/"),
212    ("docsify", "/es/docsify/"),
213    ("delete-sources", "/es/delete-sources/"),
214    ("d2lbook", "/es/d2lbook/"),
215    ("custom-404-page", "/es/custom-404-page/"),
216    ("csrf", "/es/csrf/"),
217    ("build-tools-update-2", "/es/build-tools-update-2/"),
218    ("build-tools-mamba", "/es/build-tools-mamba/"),
219    ("build-tools-conda", "/es/build-tools-conda/"),
220    ("build-tools", "/es/build-tools/"),
221    ("build-os-error-message", "/es/build-os-error-message/"),
222    ("build-latest-python-3.8", "/es/build-latest-python-3.8/"),
223    ("build-jobs-spaces-in-command", "/es/build-jobs-spaces-in-command/"),
224    ("build-jobs-post-build", "/es/build-jobs-post-build/"),
225    ("build-jobs-multiline", "/es/build-jobs-multiline/"),
226    ("build-jobs-diff-exit", "/es/build-jobs-diff-exit/"),
227    ("build-jobs", "/es/build-jobs/"),
228    ("build-image", "/es/build-image/"),
229    ("build-commands-multiline", "/es/build-commands-multiline/"),
230    ("build-commands-env-vars", "/es/build-commands-env-vars/"),
231    ("build-commands", "/es/build-commands/"),
232    ("bare-commands", "/es/bare-commands/"),
233    ("all-formats-build-jobs", "/es/all-formats-build-jobs/"),
234    ("all-formats-build-commands", "/es/all-formats-build-commands/"),
235    ("agj-test-pr", "/es/agj-test-pr/"),
236    ("agj-rtd-tf-example", "/es/agj-rtd-tf-example/"),
237    ],
238    'downloads': [ 
239    ],
240    'subprojects': [ 
241        ("stsewd-demo", "https://test.org.stsewd.dev/stsewd-demo/en/custom-404-page/"),
242    ],
243    'slug': 'another-test-stsewd',
244    'name': u'another-test-stsewd',
245    'rtd_language': u'es',
246    'programming_language': u'words',
247    'canonical_url': '',
248    'analytics_code': 'None',
249    'single_version': False,
250    'conf_py_path': '/docs/',
251    'api_host': 'https://readthedocs.org',
252    'github_user': 'readthedocs',
253    'proxied_api_host': '/_',
254    'github_repo': 'test-builds',
255    'github_version': 'python-system-packages',
256    'display_github': True,
257    'bitbucket_user': 'None',
258    'bitbucket_repo': 'None',
259    'bitbucket_version': 'python-system-packages',
260    'display_bitbucket': False,
261    'gitlab_user': 'None',
262    'gitlab_repo': 'None',
263    'gitlab_version': 'python-system-packages',
264    'display_gitlab': False,
265    'READTHEDOCS': True,
266    'using_theme': (html_theme == "default"),
267    'new_theme': (html_theme == "sphinx_rtd_theme"),
268    'source_suffix': SUFFIX,
269    'ad_free': False,
270    'docsearch_disabled': False,
271    'user_analytics_code': '',
272    'global_analytics_code': 'UA-17997319-1',
273    'commit': 'e0fc2fce',
274}
275
276# For sphinx >=1.8 we can use html_baseurl to set the canonical URL.
277# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_baseurl
278if version_info >= (1, 8):
279    if not globals().get('html_baseurl'):
280        html_baseurl = context['canonical_url']
281    context['canonical_url'] = None
282
283
284
285
286
287if 'html_context' in globals():
288    for key in context:
289        if key not in html_context:
290            html_context[key] = context[key]
291else:
292    html_context = context
293
294# Add custom RTD extension
295if 'extensions' in globals():
296    # Insert at the beginning because it can interfere
297    # with other extensions.
298    # See https://github.com/rtfd/readthedocs.org/pull/4054
299    extensions.insert(0, "readthedocs_ext.readthedocs")
300else:
301    extensions = ["readthedocs_ext.readthedocs"]
302
303# Add External version warning banner to the external version documentation
304if 'branch' == 'external':
305    extensions.insert(1, "readthedocs_ext.external_version_warning")
306    readthedocs_vcs_url = 'None'
307    readthedocs_build_url = 'https://readthedocs.org/projects/another-test-stsewd/builds/21497480/'
308
309project_language = 'es'
310
311# User's Sphinx configurations
312language_user = globals().get('language', None)
313latex_engine_user = globals().get('latex_engine', None)
314latex_elements_user = globals().get('latex_elements', None)
315
316# Remove this once xindy gets installed in Docker image and XINDYOPS
317# env variable is supported
318# https://github.com/rtfd/readthedocs-docker-images/pull/98
319latex_use_xindy = False
320
321chinese = any([
322    language_user in ('zh_CN', 'zh_TW'),
323    project_language in ('zh_CN', 'zh_TW'),
324])
325
326japanese = any([
327    language_user == 'ja',
328    project_language == 'ja',
329])
330
331if chinese:
332    latex_engine = latex_engine_user or 'xelatex'
333
334    latex_elements_rtd = {
335        'preamble': '\\usepackage[UTF8]{ctex}\n',
336    }
337    latex_elements = latex_elements_user or latex_elements_rtd
338elif japanese:
339    latex_engine = latex_engine_user or 'platex'
340
341# Make sure our build directory is always excluded
342exclude_patterns = globals().get('exclude_patterns', [])
343exclude_patterns.extend(['_build'])