mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Set hosted_on
for Read the Docs builds (#114697)
This commit is contained in:
parent
53d921ed96
commit
3996cbdd33
1 changed files with 19 additions and 18 deletions
37
Doc/conf.py
37
Doc/conf.py
|
@ -6,7 +6,9 @@
|
||||||
# The contents of this file are pickled, so don't put values in the namespace
|
# The contents of this file are pickled, so don't put values in the namespace
|
||||||
# that aren't pickleable (module imports are okay, they're removed automatically).
|
# that aren't pickleable (module imports are okay, they're removed automatically).
|
||||||
|
|
||||||
import sys, os, time
|
import os
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
sys.path.append(os.path.abspath('tools/extensions'))
|
sys.path.append(os.path.abspath('tools/extensions'))
|
||||||
sys.path.append(os.path.abspath('includes'))
|
sys.path.append(os.path.abspath('includes'))
|
||||||
|
|
||||||
|
@ -55,7 +57,7 @@ manpages_url = 'https://manpages.debian.org/{path}'
|
||||||
|
|
||||||
# General substitutions.
|
# General substitutions.
|
||||||
project = 'Python'
|
project = 'Python'
|
||||||
copyright = '2001-%s, Python Software Foundation' % time.strftime('%Y')
|
copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation"
|
||||||
|
|
||||||
# We look for the Include/patchlevel.h file in the current Python source tree
|
# We look for the Include/patchlevel.h file in the current Python source tree
|
||||||
# and replace the values accordingly.
|
# and replace the values accordingly.
|
||||||
|
@ -302,6 +304,9 @@ html_theme_options = {
|
||||||
'root_include_title': False # We use the version switcher instead.
|
'root_include_title': False # We use the version switcher instead.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if os.getenv("READTHEDOCS"):
|
||||||
|
html_theme_options["hosted_on"] = '<a href="https://about.readthedocs.com/">Read the Docs</a>'
|
||||||
|
|
||||||
# Override stylesheet fingerprinting for Windows CHM htmlhelp to fix GH-91207
|
# Override stylesheet fingerprinting for Windows CHM htmlhelp to fix GH-91207
|
||||||
# https://github.com/python/cpython/issues/91207
|
# https://github.com/python/cpython/issues/91207
|
||||||
if any('htmlhelp' in arg for arg in sys.argv):
|
if any('htmlhelp' in arg for arg in sys.argv):
|
||||||
|
@ -310,7 +315,7 @@ if any('htmlhelp' in arg for arg in sys.argv):
|
||||||
print("It may be removed in the future\n")
|
print("It may be removed in the future\n")
|
||||||
|
|
||||||
# Short title used e.g. for <title> HTML tags.
|
# Short title used e.g. for <title> HTML tags.
|
||||||
html_short_title = '%s Documentation' % release
|
html_short_title = f'{release} Documentation'
|
||||||
|
|
||||||
# Deployment preview information
|
# Deployment preview information
|
||||||
# (See .readthedocs.yml and https://docs.readthedocs.io/en/stable/reference/environment-variables.html)
|
# (See .readthedocs.yml and https://docs.readthedocs.io/en/stable/reference/environment-variables.html)
|
||||||
|
@ -359,12 +364,9 @@ html_split_index = True
|
||||||
|
|
||||||
latex_engine = 'xelatex'
|
latex_engine = 'xelatex'
|
||||||
|
|
||||||
# Get LaTeX to handle Unicode correctly
|
|
||||||
latex_elements = {
|
latex_elements = {
|
||||||
}
|
# For the LaTeX preamble.
|
||||||
|
'preamble': r'''
|
||||||
# Additional stuff for the LaTeX preamble.
|
|
||||||
latex_elements['preamble'] = r'''
|
|
||||||
\authoraddress{
|
\authoraddress{
|
||||||
\sphinxstrong{Python Software Foundation}\\
|
\sphinxstrong{Python Software Foundation}\\
|
||||||
Email: \sphinxemail{docs@python.org}
|
Email: \sphinxemail{docs@python.org}
|
||||||
|
@ -372,13 +374,12 @@ latex_elements['preamble'] = r'''
|
||||||
\let\Verbatim=\OriginalVerbatim
|
\let\Verbatim=\OriginalVerbatim
|
||||||
\let\endVerbatim=\endOriginalVerbatim
|
\let\endVerbatim=\endOriginalVerbatim
|
||||||
\setcounter{tocdepth}{2}
|
\setcounter{tocdepth}{2}
|
||||||
'''
|
''',
|
||||||
|
# The paper size ('letter' or 'a4').
|
||||||
# The paper size ('letter' or 'a4').
|
'papersize': 'a4',
|
||||||
latex_elements['papersize'] = 'a4'
|
# The font size ('10pt', '11pt' or '12pt').
|
||||||
|
'pointsize': '10pt',
|
||||||
# The font size ('10pt', '11pt' or '12pt').
|
}
|
||||||
latex_elements['pointsize'] = '10pt'
|
|
||||||
|
|
||||||
# Grouping the document tree into LaTeX files. List of tuples
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
# (source start file, target name, title, author, document class [howto/manual]).
|
# (source start file, target name, title, author, document class [howto/manual]).
|
||||||
|
@ -441,9 +442,9 @@ coverage_c_path = [
|
||||||
|
|
||||||
# Regexes to find C items in the source files.
|
# Regexes to find C items in the source files.
|
||||||
coverage_c_regexes = {
|
coverage_c_regexes = {
|
||||||
'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'),
|
'cfunction': r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)',
|
||||||
'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'),
|
'data': r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)',
|
||||||
'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'),
|
'macro': r'^#define ([^_][\w_]+)\(.*\)[\s|\\]',
|
||||||
}
|
}
|
||||||
|
|
||||||
# The coverage checker will ignore all C items whose names match these regexes
|
# The coverage checker will ignore all C items whose names match these regexes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue