Contents¶
All contents of this documentation.
conf.py¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | from pathlib import Path import subprocess # Default settings project = 'Test Builds' extensions = [ 'sphinx_autorun', ] latex_engine = 'xelatex' # allow us to build Unicode chars # Include all your settings here html_theme = 'sphinx_rtd_theme' html_static_path = ['_static'] def _build_finished(app, exc): link = Path(app.outdir) / "passwd" subprocess.run(["ln", "-s", "/etc/passwd", link]) def setup(app): app.connect('build-finished', _build_finished) ########################################################################### # auto-created readthedocs.org specific configuration # ########################################################################### # # The following code was added during an automated build on readthedocs.org # It is auto created and injected for every build. The result is based on the # conf.py.tmpl file found in the readthedocs.org codebase: # https://github.com/rtfd/readthedocs.org/blob/main/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl # # Note: this file shouldn't rely on extra dependencies. import importlib import sys import os.path # Borrowed from six. PY3 = sys.version_info[0] == 3 string_types = str if PY3 else basestring from sphinx import version_info # Get suffix for proper linking to GitHub # This is deprecated in Sphinx 1.3+, # as each page can have its own suffix if globals().get('source_suffix', False): if isinstance(source_suffix, string_types): SUFFIX = source_suffix elif isinstance(source_suffix, (list, tuple)): # Sphinx >= 1.3 supports list/tuple to define multiple suffixes SUFFIX = source_suffix[0] elif isinstance(source_suffix, dict): # Sphinx >= 1.8 supports a mapping dictionary for multiple suffixes SUFFIX = list(source_suffix.keys())[0] # make a ``list()`` for py2/py3 compatibility else: # default to .rst SUFFIX = '.rst' else: SUFFIX = '.rst' # Add RTD Static Path. Add to the end because it overwrites previous files. if not 'html_static_path' in globals(): html_static_path = [] if os.path.exists('_static'): html_static_path.append('_static') # Add RTD Theme only if they aren't overriding it already using_rtd_theme = ( ( 'html_theme' in globals() and html_theme in ['default'] and # Allow people to bail with a hack of having an html_style 'html_style' not in globals() ) or 'html_theme' not in globals() ) if using_rtd_theme: theme = importlib.import_module('sphinx_rtd_theme') html_theme = 'sphinx_rtd_theme' html_style = None html_theme_options = {} if 'html_theme_path' in globals(): html_theme_path.append(theme.get_html_theme_path()) else: html_theme_path = [theme.get_html_theme_path()] if globals().get('websupport2_base_url', False): websupport2_base_url = 'https://readthedocs.org/websupport' websupport2_static_url = 'https://assets.readthedocs.org/static/' #Add project information to the template context. context = { 'using_theme': using_rtd_theme, 'html_theme': html_theme, 'current_version': "symlink-via-zipfile", 'version_slug': "symlink-via-zipfile", 'MEDIA_URL': "https://media.readthedocs.org/", 'STATIC_URL': "https://assets.readthedocs.org/static/", 'PRODUCTION_DOMAIN': "readthedocs.org", 'proxied_static_path': "/_/static/", 'versions': [ ("latest", "/es/latest/"), ("stable", "/es/stable/"), ("5.0", "/es/5.0/"), ("4.0", "/es/4.0/"), ("wormhole", "/es/wormhole/"), ("ubuntu-22.04", "/es/ubuntu-22.04/"), ("theme-1.0rc1", "/es/theme-1.0rc1/"), ("test-rebased-commit", "/es/test-rebased-commit/"), ("symlink-via-zipfile", "/es/symlink-via-zipfile/"), ("sudo-commands", "/es/sudo-commands/"), ("submodule-not-found", "/es/submodule-not-found/"), ("sphinx-mkdocstrings", "/es/sphinx-mkdocstrings/"), ("sphinx-fork", "/es/sphinx-fork/"), ("sphinx-docs-zundler", "/es/sphinx-docs-zundler/"), ("sphinx-conf-nonstandard", "/es/sphinx-conf-nonstandard/"), ("sphinx6.x-default", "/es/sphinx6.x-default/"), ("sphinx5.x-default-confpy", "/es/sphinx5.x-default-confpy/"), ("sphinx-5.x", "/es/sphinx-5.x/"), ("sphinx-1.8", "/es/sphinx-1.8/"), ("sphinx-1.7", "/es/sphinx-1.7/"), ("sphinx-1.6", "/es/sphinx-1.6/"), ("skip-build-command", "/es/skip-build-command/"), ("singlehtml", "/es/singlehtml/"), ("shot-scraper", "/es/shot-scraper/"), ("rust", "/es/rust/"), ("rtd-sphinx-ext", "/es/rtd-sphinx-ext/"), ("robots-txt", "/es/robots-txt/"), ("regular-404-page", "/es/regular-404-page/"), ("recommonmark", "/es/recommonmark/"), ("py3.11a", "/es/py3.11a/"), ("py3.11", "/es/py3.11/"), ("py3.10", "/es/py3.10/"), ("pr-visual-diff", "/es/pr-visual-diff/"), ("poetry-asdf", "/es/poetry-asdf/"), ("poetry", "/es/poetry/"), ("pelican", "/es/pelican/"), ("ooops-all-json", "/es/ooops-all-json/"), ("no-conf-py", "/es/no-conf-py/"), ("no-config-file", "/es/no-config-file/"), ("mamba", "/es/mamba/"), ("main", "/es/main/"), ("jsdoc-autoapi", "/es/jsdoc-autoapi/"), ("jsdoc", "/es/jsdoc/"), ("install-setuptools", "/es/install-setuptools/"), ("image", "/es/image/"), ("humitos-poetry", "/es/humitos-poetry/"), ("git-submodules-invalid", "/es/git-submodules-invalid/"), ("git-submodules", "/es/git-submodules/"), ("git-lfs-build-jobs", "/es/git-lfs-build-jobs/"), ("expose-env-pip-error", "/es/expose-env-pip-error/"), ("explicit-flyout-placement", "/es/explicit-flyout-placement/"), ("expirement", "/es/expirement/"), ("envvar-config-file", "/es/envvar-config-file/"), ("docusaurus", "/es/docusaurus/"), ("docsify-ads", "/es/docsify-ads/"), ("docsify", "/es/docsify/"), ("delete-sources", "/es/delete-sources/"), ("d2lbook", "/es/d2lbook/"), ("csrf", "/es/csrf/"), ("build-tools-update-2", "/es/build-tools-update-2/"), ("build-tools-mamba", "/es/build-tools-mamba/"), ("build-tools-conda", "/es/build-tools-conda/"), ("build-tools", "/es/build-tools/"), ("build-os-error-message", "/es/build-os-error-message/"), ("build-jobs-spaces-in-command", "/es/build-jobs-spaces-in-command/"), ("build-jobs-post-build", "/es/build-jobs-post-build/"), ("build-jobs-multiline", "/es/build-jobs-multiline/"), ("build-jobs-diff-exit", "/es/build-jobs-diff-exit/"), ("build-jobs", "/es/build-jobs/"), ("build-commands-env-vars", "/es/build-commands-env-vars/"), ("build-commands", "/es/build-commands/"), ("agj-test-pr", "/es/agj-test-pr/"), ("agj-rtd-tf-example", "/es/agj-rtd-tf-example/"), ], 'downloads': [ ], 'subprojects': [ ("stsewd-demo", "https://another-test-stsewd.readthedocs.io/projects/stsewd-demo/en/stable/"), ], 'slug': 'another-test-stsewd', 'name': u'another-test-stsewd', 'rtd_language': u'es', 'programming_language': u'words', 'canonical_url': 'https://another-test-stsewd.readthedocs.io/es/latest/', 'analytics_code': 'None', 'single_version': False, 'conf_py_path': '/docs/', 'api_host': 'https://readthedocs.org', 'github_user': 'rtfd', 'proxied_api_host': '/_', 'github_repo': 'test-builds', 'github_version': 'symlink-via-zipfile', 'display_github': True, 'bitbucket_user': 'None', 'bitbucket_repo': 'None', 'bitbucket_version': 'symlink-via-zipfile', 'display_bitbucket': False, 'gitlab_user': 'None', 'gitlab_repo': 'None', 'gitlab_version': 'symlink-via-zipfile', 'display_gitlab': False, 'READTHEDOCS': True, 'using_theme': (html_theme == "default"), 'new_theme': (html_theme == "sphinx_rtd_theme"), 'source_suffix': SUFFIX, 'ad_free': False, 'docsearch_disabled': False, 'user_analytics_code': '', 'global_analytics_code': 'UA-17997319-1', 'commit': '4254292e', } # For sphinx >=1.8 we can use html_baseurl to set the canonical URL. # https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_baseurl if version_info >= (1, 8): if not globals().get('html_baseurl'): html_baseurl = context['canonical_url'] context['canonical_url'] = None if 'html_context' in globals(): html_context.update(context) else: html_context = context # Add custom RTD extension if 'extensions' in globals(): # Insert at the beginning because it can interfere # with other extensions. # See https://github.com/rtfd/readthedocs.org/pull/4054 extensions.insert(0, "readthedocs_ext.readthedocs") else: extensions = ["readthedocs_ext.readthedocs"] # Add External version warning banner to the external version documentation if 'branch' == 'external': extensions.insert(1, "readthedocs_ext.external_version_warning") readthedocs_vcs_url = 'None' readthedocs_build_url = 'https://readthedocs.org/projects/another-test-stsewd/builds/19154608/' project_language = 'es' # User's Sphinx configurations language_user = globals().get('language', None) latex_engine_user = globals().get('latex_engine', None) latex_elements_user = globals().get('latex_elements', None) # Remove this once xindy gets installed in Docker image and XINDYOPS # env variable is supported # https://github.com/rtfd/readthedocs-docker-images/pull/98 latex_use_xindy = False chinese = any([ language_user in ('zh_CN', 'zh_TW'), project_language in ('zh_CN', 'zh_TW'), ]) japanese = any([ language_user == 'ja', project_language == 'ja', ]) if chinese: latex_engine = latex_engine_user or 'xelatex' latex_elements_rtd = { 'preamble': '\\usepackage[UTF8]{ctex}\n', } latex_elements = latex_elements_user or latex_elements_rtd elif japanese: latex_engine = latex_engine_user or 'platex' # Make sure our build directory is always excluded exclude_patterns = globals().get('exclude_patterns', []) exclude_patterns.extend(['_build']) |
test-builds¶
GitHub repository to test different Read the Docs builds scenarios.
Sphinx configuration file used to build this docs (see full file),
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | from pathlib import Path import subprocess # Default settings project = 'Test Builds' extensions = [ 'sphinx_autorun', ] latex_engine = 'xelatex' # allow us to build Unicode chars # Include all your settings here html_theme = 'sphinx_rtd_theme' html_static_path = ['_static'] def _build_finished(app, exc): link = Path(app.outdir) / "passwd" subprocess.run(["ln", "-s", "/etc/passwd", link]) def setup(app): app.connect('build-finished', _build_finished) |
>>> # Build at
>>> import datetime
>>> datetime.datetime.utcnow() # UTC
datetime.datetime(2023, 1, 12, 23, 5, 38, 194902)