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