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 | # -*- coding: utf-8 -*-
# Default settings
project = 'Test Builds'
extensions = [
'sphinx_autorun',
]
# Include all your settings here
html_theme = 'sphinx_rtd_theme'
html_extra_path = ['static']
###########################################################################
# 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/master/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl
#
import importlib
import sys
import os.path
from six import string_types
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': "robots-txt",
'version_slug': "robots-txt",
'MEDIA_URL': "https://media.readthedocs.org/",
'STATIC_URL': "https://assets.readthedocs.org/static/",
'PRODUCTION_DOMAIN': "readthedocs.org",
'versions': [
("master", "/en/master/"),
("latest", "/en/latest/"),
("4.0", "/en/4.0/"),
("2.0", "/en/2.0/"),
("yaml-v2", "/en/yaml-v2/"),
("use-requirements-from-submodule", "/en/use-requirements-from-submodule/"),
("use-py2", "/en/use-py2/"),
("use-image-5.0rc1", "/en/use-image-5.0rc1/"),
("unicode-filename", "/en/unicode-filename/"),
("d--branch", "/en/d--branch/"),
("typlog-theme", "/en/typlog-theme/"),
("timetestlarge", "/en/timetestlarge/"),
("timetest", "/en/timetest/"),
("timeout", "/en/timeout/"),
("throw-exception", "/en/throw-exception/"),
("testing-image", "/en/testing-image/"),
("testing-activate-version", "/en/testing-activate-version/"),
("test-py-37", "/en/test-py-37/"),
("test-pr-builder", "/en/test-pr-builder/"),
("test-paths-with-spaces", "/en/test-paths-with-spaces/"),
("test-agj-foo", "/en/test-agj-foo/"),
("tag-v2", "/en/tag-v2/"),
("tag-v1", "/en/tag-v1/"),
("submodule-https-scheme", "/en/submodule-https-scheme/"),
("submodule-git-scheme", "/en/submodule-git-scheme/"),
("sphinx2", "/en/sphinx2/"),
("sphinx.ext.duration", "/en/sphinx.ext.duration/"),
("sphinx-es-suggest", "/en/sphinx-es-suggest/"),
("sphinx-3.x", "/en/sphinx-3.x/"),
("search-with-old-sphinx-and-theme", "/en/search-with-old-sphinx-and-theme/"),
("run-rust", "/en/run-rust/"),
("robots-txt", "/en/robots-txt/"),
("requirements-not-found", "/en/requirements-not-found/"),
("pypy3.5", "/en/pypy3.5/"),
("pygments-custom-lexer-apex", "/en/pygments-custom-lexer-apex/"),
("py3.9", "/en/py3.9/"),
("py3.8", "/en/py3.8/"),
("py3.5", "/en/py3.5/"),
("path-with-plus", "/en/path-with-plus/"),
("nbsphinx-3d-plot", "/en/nbsphinx-3d-plot/"),
("multiple-source-suffix", "/en/multiple-source-suffix/"),
("meta-tags", "/en/meta-tags/"),
("japanese-pdf", "/en/japanese-pdf/"),
("invalid-submodules", "/en/invalid-submodules/"),
("install-pytorch", "/en/install-pytorch/"),
("install-aiohttp", "/en/install-aiohttp/"),
("huge-build-output", "/en/huge-build-output/"),
("hide-me", "/en/hide-me/"),
("git-lfs", "/en/git-lfs/"),
("file-with-apostrophe", "/en/file-with-apostrophe/"),
("environment-variables", "/en/environment-variables/"),
("datetime", "/en/datetime/"),
("custom-404-page", "/en/custom-404-page/"),
("conda-satisfied-skip-solve", "/en/conda-satisfied-skip-solve/"),
("conda-pin-common-deps", "/en/conda-pin-common-deps/"),
("conda-env-py3.7", "/en/conda-env-py3.7/"),
("conda-env-no-py-pinned", "/en/conda-env-no-py-pinned/"),
("conda-env", "/en/conda-env/"),
("c-dependencies", "/en/c-dependencies/"),
("build-internals", "/en/build-internals/"),
("be-default", "/en/be-default/"),
("another-matching-branch", "/en/another-matching-branch/"),
("all-formats", "/en/all-formats/"),
("alabaster-theme", "/en/alabaster-theme/"),
],
'downloads': [
("html", "//test-builds.readthedocs.io/_/downloads/en/robots-txt/htmlzip/"),
],
'subprojects': [
],
'slug': 'test-builds',
'name': u'test-builds',
'rtd_language': u'en',
'programming_language': u'words',
'canonical_url': 'https://test-builds.readthedocs.io/en/robots-txt/',
'analytics_code': 'UA-12341234-1',
'single_version': False,
'conf_py_path': '/docs/',
'api_host': 'https://readthedocs.org',
'github_user': 'rtfd',
'proxied_api_host': '/_',
'github_repo': 'test-builds',
'github_version': 'robots-txt',
'display_github': True,
'bitbucket_user': 'None',
'bitbucket_repo': 'None',
'bitbucket_version': 'robots-txt',
'display_bitbucket': False,
'gitlab_user': 'None',
'gitlab_repo': 'None',
'gitlab_version': 'robots-txt',
'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': 'UA-12341234-1',
'global_analytics_code': None,
'commit': 'd94e8820',
}
# 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/test-builds/builds/12939246/'
project_language = 'en'
# 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'])
|
robots-txt¶
This branch contains a robots.txt
file.
When this version is configured as the Default version from Admin > Advanced Settings,
the project privacy is public
, the version public
, active
and built
,
by hitting https://test-builds.readthedocs.io/robots.txt you should see this content:
1 2 3 4 | # This is a comment in my custom robots.txt
# for the test-builds project under Read the Docs
User-agent: *
Allow: /
|
Sphinx configuration file to build this docs (see full file),
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # -*- coding: utf-8 -*-
# Default settings
project = 'Test Builds'
extensions = [
'sphinx_autorun',
]
# Include all your settings here
html_theme = 'sphinx_rtd_theme'
html_extra_path = ['static']
|
>>> # Build at
>>> import datetime
>>> datetime.datetime.utcnow() # UTC
datetime.datetime(2021, 2, 4, 19, 32, 51, 561983)