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': "latest",
106 'version_slug': "latest",
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", "/en/latest/"),
113 ("stable", "/en/stable/"),
114 ],
115 'downloads': [
116 ],
117 'subprojects': [
118 ],
119 'slug': 'test-delete',
120 'name': u'test-delete',
121 'rtd_language': u'en',
122 'programming_language': u'words',
123 'canonical_url': 'https://test-delete.readthedocs.io/en/latest/',
124 'analytics_code': 'None',
125 'single_version': False,
126 'conf_py_path': '/docs/',
127 'api_host': 'https://readthedocs.org',
128 'github_user': 'readthedocs',
129 'proxied_api_host': '/_',
130 'github_repo': 'test-builds',
131 'github_version': 'main',
132 'display_github': True,
133 'bitbucket_user': 'None',
134 'bitbucket_repo': 'None',
135 'bitbucket_version': 'main',
136 'display_bitbucket': False,
137 'gitlab_user': 'None',
138 'gitlab_repo': 'None',
139 'gitlab_version': 'main',
140 'display_gitlab': False,
141 'READTHEDOCS': True,
142 'using_theme': (html_theme == "default"),
143 'new_theme': (html_theme == "sphinx_rtd_theme"),
144 'source_suffix': SUFFIX,
145 'ad_free': False,
146 'docsearch_disabled': False,
147 'user_analytics_code': '',
148 'global_analytics_code': 'UA-17997319-1',
149 'commit': '70ff6770',
150}
151
152# For sphinx >=1.8 we can use html_baseurl to set the canonical URL.
153# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_baseurl
154if version_info >= (1, 8):
155 if not globals().get('html_baseurl'):
156 html_baseurl = context['canonical_url']
157 context['canonical_url'] = None
158
159
160
161
162
163if 'html_context' in globals():
164
165 html_context.update(context)
166
167else:
168 html_context = context
169
170# Add custom RTD extension
171if 'extensions' in globals():
172 # Insert at the beginning because it can interfere
173 # with other extensions.
174 # See https://github.com/rtfd/readthedocs.org/pull/4054
175 extensions.insert(0, "readthedocs_ext.readthedocs")
176else:
177 extensions = ["readthedocs_ext.readthedocs"]
178
179# Add External version warning banner to the external version documentation
180if 'branch' == 'external':
181 extensions.insert(1, "readthedocs_ext.external_version_warning")
182 readthedocs_vcs_url = 'None'
183 readthedocs_build_url = 'https://readthedocs.org/projects/test-delete/builds/19434830/'
184
185project_language = 'en'
186
187# User's Sphinx configurations
188language_user = globals().get('language', None)
189latex_engine_user = globals().get('latex_engine', None)
190latex_elements_user = globals().get('latex_elements', None)
191
192# Remove this once xindy gets installed in Docker image and XINDYOPS
193# env variable is supported
194# https://github.com/rtfd/readthedocs-docker-images/pull/98
195latex_use_xindy = False
196
197chinese = any([
198 language_user in ('zh_CN', 'zh_TW'),
199 project_language in ('zh_CN', 'zh_TW'),
200])
201
202japanese = any([
203 language_user == 'ja',
204 project_language == 'ja',
205])
206
207if chinese:
208 latex_engine = latex_engine_user or 'xelatex'
209
210 latex_elements_rtd = {
211 'preamble': '\\usepackage[UTF8]{ctex}\n',
212 }
213 latex_elements = latex_elements_user or latex_elements_rtd
214elif japanese:
215 latex_engine = latex_engine_user or 'platex'
216
217# Make sure our build directory is always excluded
218exclude_patterns = globals().get('exclude_patterns', [])
219exclude_patterns.extend(['_build'])