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# Define this variable in case it's not defined by the user.
 66# It defaults to `alabaster` which is the default from Sphinx.
 67# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_theme
 68html_theme = globals().get('html_theme', 'alabaster')
 69
 70#Add project information to the template context.
 71context = {
 72    'html_theme': html_theme,
 73    'current_version': "latest",
 74    'version_slug': "latest",
 75    'MEDIA_URL': "https://media.readthedocs.org/",
 76    'STATIC_URL': "https://assets.readthedocs.org/static/",
 77    'PRODUCTION_DOMAIN': "readthedocs.org",
 78    'proxied_static_path': "/_/static/",
 79    'versions': [
 80    ("latest", "/es/latest/"),
 81    ("stable", "/es/stable/"),
 82    ("5.0", "/es/5.0/"),
 83    ("4.0", "/es/4.0/"),
 84    ("wormhole", "/es/wormhole/"),
 85    ("update-conda-startup", "/es/update-conda-startup/"),
 86    ("ubuntu-22.04-python3.x", "/es/ubuntu-22.04-python3.x/"),
 87    ("ubuntu-22.04-python3.6", "/es/ubuntu-22.04-python3.6/"),
 88    ("ubuntu-22.04-python3.12", "/es/ubuntu-22.04-python3.12/"),
 89    ("ubuntu-22.04-python2.7", "/es/ubuntu-22.04-python2.7/"),
 90    ("ubuntu-22.04", "/es/ubuntu-22.04/"),
 91    ("ubuntu-20.04-python-3.9", "/es/ubuntu-20.04-python-3.9/"),
 92    ("ubuntu-20.04", "/es/ubuntu-20.04/"),
 93    ("theme-1.0rc1", "/es/theme-1.0rc1/"),
 94    ("test-ubuntu-20.04", "/es/test-ubuntu-20.04/"),
 95    ("test-sphinx-4", "/es/test-sphinx-4/"),
 96    ("test-rebased-commit", "/es/test-rebased-commit/"),
 97    ("test-python-latest-alias", "/es/test-python-latest-alias/"),
 98    ("test-parent-path-error", "/es/test-parent-path-error/"),
 99    ("test-branch", "/es/test-branch/"),
100    ("test-auto-cancel", "/es/test-auto-cancel/"),
101    ("template-config-file", "/es/template-config-file/"),
102    ("symlink-via-zipfile", "/es/symlink-via-zipfile/"),
103    ("sudo-commands", "/es/sudo-commands/"),
104    ("submodule-not-found", "/es/submodule-not-found/"),
105    ("staticrypt", "/es/staticrypt/"),
106    ("sphinx-tectonic-pdf", "/es/sphinx-tectonic-pdf/"),
107    ("sphinx-multipage-html", "/es/sphinx-multipage-html/"),
108    ("sphinx-mkdocstrings", "/es/sphinx-mkdocstrings/"),
109    ("sphinx-hoverxref", "/es/sphinx-hoverxref/"),
110    ("sphinx-fork", "/es/sphinx-fork/"),
111    ("sphinx-docs-zundler", "/es/sphinx-docs-zundler/"),
112    ("sphinx-conf-nonstandard", "/es/sphinx-conf-nonstandard/"),
113    ("sphinx-awesome", "/es/sphinx-awesome/"),
114    ("sphinx-7.0.x", "/es/sphinx-7.0.x/"),
115    ("sphinx6.x-default", "/es/sphinx6.x-default/"),
116    ("sphinx5.x-default-confpy", "/es/sphinx5.x-default-confpy/"),
117    ("sphinx-5.x", "/es/sphinx-5.x/"),
118    ("sphinx-1.8", "/es/sphinx-1.8/"),
119    ("sphinx-1.7", "/es/sphinx-1.7/"),
120    ("sphinx-1.6", "/es/sphinx-1.6/"),
121    ("skip-build-command-pr-test3", "/es/skip-build-command-pr-test3/"),
122    ("skip-build-command-pr-test2", "/es/skip-build-command-pr-test2/"),
123    ("skip-build-command-pr-test", "/es/skip-build-command-pr-test/"),
124    ("skip-build-command", "/es/skip-build-command/"),
125    ("singlehtml", "/es/singlehtml/"),
126    ("shot-scraper", "/es/shot-scraper/"),
127    ("search-special-chars", "/es/search-special-chars/"),
128    ("rust-1.75", "/es/rust-1.75/"),
129    ("rust-1.70", "/es/rust-1.70/"),
130    ("rust", "/es/rust/"),
131    ("ruby-3.3", "/es/ruby-3.3/"),
132    ("rtd-sphinx-ext", "/es/rtd-sphinx-ext/"),
133    ("robots-txt", "/es/robots-txt/"),
134    ("regular-404-page", "/es/regular-404-page/"),
135    ("recommonmark", "/es/recommonmark/"),
136    ("readthedocs-docs-build-commands", "/es/readthedocs-docs-build-commands/"),
137    ("python-system-packages", "/es/python-system-packages/"),
138    ("python-setuptools-package", "/es/python-setuptools-package/"),
139    ("py3.11a", "/es/py3.11a/"),
140    ("py3.11", "/es/py3.11/"),
141    ("py3.10", "/es/py3.10/"),
142    ("pr-visual-diff", "/es/pr-visual-diff/"),
143    ("pr-test-git-clone-test", "/es/pr-test-git-clone-test/"),
144    ("pr-test", "/es/pr-test/"),
145    ("pr-readthedocs_output", "/es/pr-readthedocs_output/"),
146    ("pr-js-client", "/es/pr-js-client/"),
147    ("pr-homepage-edition", "/es/pr-homepage-edition/"),
148    ("pr-docusaurus", "/es/pr-docusaurus/"),
149    ("poetry-asdf", "/es/poetry-asdf/"),
150    ("poetry", "/es/poetry/"),
151    ("pelican", "/es/pelican/"),
152    ("pdf-rinohtype", "/es/pdf-rinohtype/"),
153    ("pdf-multiple", "/es/pdf-multiple/"),
154    ("pdf-cmd-fail", "/es/pdf-cmd-fail/"),
155    ("pdf-build-jobs", "/es/pdf-build-jobs/"),
156    ("ooops-all-json", "/es/ooops-all-json/"),
157    ("old-output-directory", "/es/old-output-directory/"),
158    ("no-pr-build", "/es/no-pr-build/"),
159    ("no-html-theme-defined", "/es/no-html-theme-defined/"),
160    ("no-conf-py", "/es/no-conf-py/"),
161    ("no-config-file", "/es/no-config-file/"),
162    ("monorepo", "/es/monorepo/"),
163    ("mkdocs-terminal", "/es/mkdocs-terminal/"),
164    ("mkdocs-pdf", "/es/mkdocs-pdf/"),
165    ("mkdocs-material", "/es/mkdocs-material/"),
166    ("mkdocs-htmlzip", "/es/mkdocs-htmlzip/"),
167    ("mkdocs-config-at-root", "/es/mkdocs-config-at-root/"),
168    ("mkdocs", "/es/mkdocs/"),
169    ("manual-integrations", "/es/manual-integrations/"),
170    ("manual-integration-docsify", "/es/manual-integration-docsify/"),
171    ("mamba", "/es/mamba/"),
172    ("main", "/es/main/"),
173    ("linkcheck", "/es/linkcheck/"),
174    ("latest-aliases", "/es/latest-aliases/"),
175    ("jupyter-notebook", "/es/jupyter-notebook/"),
176    ("jupyter-book", "/es/jupyter-book/"),
177    ("jsdoc-autoapi", "/es/jsdoc-autoapi/"),
178    ("jsdoc", "/es/jsdoc/"),
179    ("jekyll", "/es/jekyll/"),
180    ("invalid-docker-image", "/es/invalid-docker-image/"),
181    ("install-setuptools", "/es/install-setuptools/"),
182    ("image", "/es/image/"),
183    ("humitos-poetry", "/es/humitos-poetry/"),
184    ("humitos-patch-2", "/es/humitos-patch-2/"),
185    ("humitos-patch-1", "/es/humitos-patch-1/"),
186    ("git-submodules-invalid", "/es/git-submodules-invalid/"),
187    ("git-submodules", "/es/git-submodules/"),
188    ("git-lfs-build-jobs", "/es/git-lfs-build-jobs/"),
189    ("furo", "/es/furo/"),
190    ("foo", "/es/foo/"),
191    ("expose-env-pip-error", "/es/expose-env-pip-error/"),
192    ("explicit-flyout-placement", "/es/explicit-flyout-placement/"),
193    ("expirement", "/es/expirement/"),
194    ("envvar-config-file", "/es/envvar-config-file/"),
195    ("docusaurus", "/es/docusaurus/"),
196    ("docsify-ads", "/es/docsify-ads/"),
197    ("docsify", "/es/docsify/"),
198    ("docdiff-example", "/es/docdiff-example/"),
199    ("delete-sources", "/es/delete-sources/"),
200    ("d2lbook", "/es/d2lbook/"),
201    ("custom-404-page", "/es/custom-404-page/"),
202    ("csrf", "/es/csrf/"),
203    ("config-file-with-wrong-version-number", "/es/config-file-with-wrong-version-number/"),
204    ("conda-build-commands", "/es/conda-build-commands/"),
205    ("build-tools-update-2", "/es/build-tools-update-2/"),
206    ("build-tools-mamba", "/es/build-tools-mamba/"),
207    ("build-tools-golang-invalid", "/es/build-tools-golang-invalid/"),
208    ("build-tools-conda", "/es/build-tools-conda/"),
209    ("build-tools", "/es/build-tools/"),
210    ("build-os-error-message", "/es/build-os-error-message/"),
211    ("build-latest-python-3.8", "/es/build-latest-python-3.8/"),
212    ("build-jobs-spaces-in-command", "/es/build-jobs-spaces-in-command/"),
213    ("build-jobs-post-build", "/es/build-jobs-post-build/"),
214    ("build-jobs-multiline", "/es/build-jobs-multiline/"),
215    ("build-jobs-diff-exit", "/es/build-jobs-diff-exit/"),
216    ("build-jobs", "/es/build-jobs/"),
217    ("build-image", "/es/build-image/"),
218    ("build-commands-pr", "/es/build-commands-pr/"),
219    ("build-commands-multiline", "/es/build-commands-multiline/"),
220    ("build-commands-env-vars", "/es/build-commands-env-vars/"),
221    ("build-commands", "/es/build-commands/"),
222    ("bare-commands", "/es/bare-commands/"),
223    ("asciidoctor", "/es/asciidoctor/"),
224    ("antora", "/es/antora/"),
225    ("all-formats-build-jobs", "/es/all-formats-build-jobs/"),
226    ("all-formats-build-commands", "/es/all-formats-build-commands/"),
227    ("agj-test-pr", "/es/agj-test-pr/"),
228    ("agj-rtd-tf-example", "/es/agj-rtd-tf-example/"),
229    ],
230    'downloads': [ 
231    ],
232    'subprojects': [ 
233        ("stsewd-demo", "https://test.org.stsewd.dev/stsewd-demo/en/custom-404-page/"),
234    ],
235    'slug': 'another-test-stsewd',
236    'name': u'another-test-stsewd',
237    'rtd_language': u'es',
238    'programming_language': u'words',
239    'canonical_url': '',
240    'analytics_code': 'None',
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': 'main',
248    'display_github': True,
249    'bitbucket_user': 'None',
250    'bitbucket_repo': 'None',
251    'bitbucket_version': 'main',
252    'display_bitbucket': False,
253    'gitlab_user': 'None',
254    'gitlab_repo': 'None',
255    'gitlab_version': 'main',
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': '',
264    'global_analytics_code': 'UA-17997319-1',
265    'commit': '88245884',
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/another-test-stsewd/builds/23755014/'
300
301project_language = 'es'
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'])