conf.py

  1# Default settings
  2project = 'Test Builds'
  3extensions = [
  4    'sphinx_autorun',
  5]
  6
  7html_static_path = ['_static']
  8
  9html_js_files = ['test.js']
 10
 11latex_engine = 'xelatex'  # allow us to build Unicode chars
 12root_doc = 'index'
 13
 14
 15# Include all your settings here
 16html_theme = 'sphinx_rtd_theme'
 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# Add RTD Theme only if they aren't overriding it already
 69using_rtd_theme = (
 70    (
 71        'html_theme' in globals() and
 72        html_theme in ['default'] and
 73        # Allow people to bail with a hack of having an html_style
 74        'html_style' not in globals()
 75    ) or 'html_theme' not in globals()
 76)
 77if using_rtd_theme:
 78    theme = importlib.import_module('sphinx_rtd_theme')
 79    html_theme = 'sphinx_rtd_theme'
 80    html_style = None
 81    html_theme_options = {}
 82    if 'html_theme_path' in globals():
 83        html_theme_path.append(theme.get_html_theme_path())
 84    else:
 85        html_theme_path = [theme.get_html_theme_path()]
 86
 87if globals().get('websupport2_base_url', False):
 88    websupport2_base_url = 'https://readthedocs.org/websupport'
 89    websupport2_static_url = 'https://assets.readthedocs.org/static/'
 90
 91
 92#Add project information to the template context.
 93context = {
 94    'using_theme': using_rtd_theme,
 95    'html_theme': html_theme,
 96    'current_version': "image",
 97    'version_slug': "image",
 98    'MEDIA_URL': "https://media.readthedocs.org/",
 99    'STATIC_URL': "https://assets.readthedocs.org/static/",
100    'PRODUCTION_DOMAIN': "readthedocs.org",
101    'proxied_static_path': "/_/static/",
102    'versions': [
103    ("latest", "/es/latest/"),
104    ("stable", "/es/stable/"),
105    ("5.0", "/es/5.0/"),
106    ("4.0", "/es/4.0/"),
107    ("ubuntu-22.04", "/es/ubuntu-22.04/"),
108    ("theme-1.0rc1", "/es/theme-1.0rc1/"),
109    ("sphinx-fork", "/es/sphinx-fork/"),
110    ("sphinx-1.8", "/es/sphinx-1.8/"),
111    ("sphinx-1.7", "/es/sphinx-1.7/"),
112    ("sphinx-1.6", "/es/sphinx-1.6/"),
113    ("rust", "/es/rust/"),
114    ("robots-txt", "/es/robots-txt/"),
115    ("py3.11a", "/es/py3.11a/"),
116    ("py3.10", "/es/py3.10/"),
117    ("poetry", "/es/poetry/"),
118    ("ooops-all-json", "/es/ooops-all-json/"),
119    ("no-config-file", "/es/no-config-file/"),
120    ("mamba", "/es/mamba/"),
121    ("main", "/es/main/"),
122    ("image", "/es/image/"),
123    ("git-lfs-build-jobs", "/es/git-lfs-build-jobs/"),
124    ("expose-env-pip-error", "/es/expose-env-pip-error/"),
125    ("csrf", "/es/csrf/"),
126    ("build-tools-mamba", "/es/build-tools-mamba/"),
127    ("build-tools-conda", "/es/build-tools-conda/"),
128    ("build-tools", "/es/build-tools/"),
129    ("build-os-error-message", "/es/build-os-error-message/"),
130    ("build-jobs-multiline", "/es/build-jobs-multiline/"),
131    ("build-jobs", "/es/build-jobs/"),
132    ("build-commands", "/es/build-commands/"),
133    ("agj-test-pr", "/es/agj-test-pr/"),
134    ],
135    'downloads': [ 
136    ],
137    'subprojects': [ 
138        ("stsewd-demo", "https://another-test-stsewd.readthedocs.io/projects/stsewd-demo/en/stable/"),
139    ],
140    'slug': 'another-test-stsewd',
141    'name': u'another-test-stsewd',
142    'rtd_language': u'es',
143    'programming_language': u'words',
144    'canonical_url': 'https://another-test-stsewd.readthedocs.io/es/latest/',
145    'analytics_code': 'None',
146    'single_version': False,
147    'conf_py_path': '/docs/',
148    'api_host': 'https://readthedocs.org',
149    'github_user': 'rtfd',
150    'proxied_api_host': '/_',
151    'github_repo': 'test-builds',
152    'github_version': 'image',
153    'display_github': True,
154    'bitbucket_user': 'None',
155    'bitbucket_repo': 'None',
156    'bitbucket_version': 'image',
157    'display_bitbucket': False,
158    'gitlab_user': 'None',
159    'gitlab_repo': 'None',
160    'gitlab_version': 'image',
161    'display_gitlab': False,
162    'READTHEDOCS': True,
163    'using_theme': (html_theme == "default"),
164    'new_theme': (html_theme == "sphinx_rtd_theme"),
165    'source_suffix': SUFFIX,
166    'ad_free': False,
167    'docsearch_disabled': False,
168    'user_analytics_code': '',
169    'global_analytics_code': 'UA-17997319-1',
170    'commit': 'a97275b3',
171}
172
173# For sphinx >=1.8 we can use html_baseurl to set the canonical URL.
174# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_baseurl
175if version_info >= (1, 8):
176    if not globals().get('html_baseurl'):
177        html_baseurl = context['canonical_url']
178    context['canonical_url'] = None
179
180
181
182
183
184if 'html_context' in globals():
185    
186    html_context.update(context)
187    
188else:
189    html_context = context
190
191# Add custom RTD extension
192if 'extensions' in globals():
193    # Insert at the beginning because it can interfere
194    # with other extensions.
195    # See https://github.com/rtfd/readthedocs.org/pull/4054
196    extensions.insert(0, "readthedocs_ext.readthedocs")
197else:
198    extensions = ["readthedocs_ext.readthedocs"]
199
200# Add External version warning banner to the external version documentation
201if 'branch' == 'external':
202    extensions.insert(1, "readthedocs_ext.external_version_warning")
203    readthedocs_vcs_url = 'None'
204    readthedocs_build_url = 'https://readthedocs.org/projects/another-test-stsewd/builds/16936895/'
205
206project_language = 'es'
207
208# User's Sphinx configurations
209language_user = globals().get('language', None)
210latex_engine_user = globals().get('latex_engine', None)
211latex_elements_user = globals().get('latex_elements', None)
212
213# Remove this once xindy gets installed in Docker image and XINDYOPS
214# env variable is supported
215# https://github.com/rtfd/readthedocs-docker-images/pull/98
216latex_use_xindy = False
217
218chinese = any([
219    language_user in ('zh_CN', 'zh_TW'),
220    project_language in ('zh_CN', 'zh_TW'),
221])
222
223japanese = any([
224    language_user == 'ja',
225    project_language == 'ja',
226])
227
228if chinese:
229    latex_engine = latex_engine_user or 'xelatex'
230
231    latex_elements_rtd = {
232        'preamble': '\\usepackage[UTF8]{ctex}\n',
233    }
234    latex_elements = latex_elements_user or latex_elements_rtd
235elif japanese:
236    latex_engine = latex_engine_user or 'platex'
237
238# Make sure our build directory is always excluded
239exclude_patterns = globals().get('exclude_patterns', [])
240exclude_patterns.extend(['_build'])