| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
import sys, os, time |
| 11 |
sys.path.append(os.path.abspath('tools/extensions')) |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
extensions = ['sphinx.ext.coverage', 'sphinx.ext.doctest', |
| 17 |
'pyspecific', 'c_annotations'] |
| 18 |
|
| 19 |
|
| 20 |
project = 'Python' |
| 21 |
copyright = '1990-%s, Python Software Foundation' % time.strftime('%Y') |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
import patchlevel |
| 26 |
version, release = patchlevel.get_version_info() |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
today = '' |
| 31 |
|
| 32 |
today_fmt = '%B %d, %Y' |
| 33 |
|
| 34 |
|
| 35 |
exclude_patterns = [ |
| 36 |
'maclib/scrap.rst', |
| 37 |
'library/xmllib.rst', |
| 38 |
'library/xml.etree.rst', |
| 39 |
] |
| 40 |
|
| 41 |
|
| 42 |
needs_sphinx = '1.2' |
| 43 |
|
| 44 |
|
| 45 |
master_doc = 'contents' |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
html_theme = 'default' |
| 51 |
html_theme_options = {'collapsiblesidebar': True} |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
html_last_updated_fmt = '%b %d, %Y' |
| 56 |
|
| 57 |
|
| 58 |
templates_path = ['tools/templates'] |
| 59 |
|
| 60 |
|
| 61 |
html_sidebars = { |
| 62 |
'index': ['indexsidebar.html'], |
| 63 |
} |
| 64 |
|
| 65 |
|
| 66 |
html_additional_pages = { |
| 67 |
'download': 'download.html', |
| 68 |
'index': 'indexcontent.html', |
| 69 |
} |
| 70 |
|
| 71 |
|
| 72 |
html_use_opensearch = 'https://docs.python.org/' |
| 73 |
|
| 74 |
|
| 75 |
html_static_path = ['tools/static'] |
| 76 |
|
| 77 |
|
| 78 |
htmlhelp_basename = 'python' + release.replace('.', '') |
| 79 |
|
| 80 |
|
| 81 |
html_split_index = True |
| 82 |
|
| 83 |
html_context = { |
| 84 |
'outdated': True |
| 85 |
} |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
latex_engine = 'xelatex' |
| 92 |
|
| 93 |
|
| 94 |
latex_elements = { |
| 95 |
} |
| 96 |
|
| 97 |
|
| 98 |
latex_elements['preamble'] = r''' |
| 99 |
\authoraddress{ |
| 100 |
\sphinxstrong{Python Software Foundation}\\ |
| 101 |
Email: \sphinxemail{[email protected]} |
| 102 |
} |
| 103 |
\let\Verbatim=\OriginalVerbatim |
| 104 |
\let\endVerbatim=\endOriginalVerbatim |
| 105 |
''' |
| 106 |
|
| 107 |
|
| 108 |
latex_elements['papersize'] = 'a4' |
| 109 |
|
| 110 |
|
| 111 |
latex_elements['pointsize'] = '10pt' |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
_stdauthor = r'Guido van Rossum\\and the Python development team' |
| 116 |
latex_documents = [ |
| 117 |
('c-api/index', 'c-api.tex', |
| 118 |
'The Python/C API', _stdauthor, 'manual'), |
| 119 |
('distributing/index', 'distributing.tex', |
| 120 |
'Distributing Python Modules', _stdauthor, 'manual'), |
| 121 |
('extending/index', 'extending.tex', |
| 122 |
'Extending and Embedding Python', _stdauthor, 'manual'), |
| 123 |
('installing/index', 'installing.tex', |
| 124 |
'Installing Python Modules', _stdauthor, 'manual'), |
| 125 |
('library/index', 'library.tex', |
| 126 |
'The Python Library Reference', _stdauthor, 'manual'), |
| 127 |
('reference/index', 'reference.tex', |
| 128 |
'The Python Language Reference', _stdauthor, 'manual'), |
| 129 |
('tutorial/index', 'tutorial.tex', |
| 130 |
'Python Tutorial', _stdauthor, 'manual'), |
| 131 |
('using/index', 'using.tex', |
| 132 |
'Python Setup and Usage', _stdauthor, 'manual'), |
| 133 |
('faq/index', 'faq.tex', |
| 134 |
'Python Frequently Asked Questions', _stdauthor, 'manual'), |
| 135 |
('whatsnew/' + version, 'whatsnew.tex', |
| 136 |
'What\'s New in Python', 'A. M. Kuchling', 'howto'), |
| 137 |
] |
| 138 |
|
| 139 |
latex_documents.extend(('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex', |
| 140 |
'', _stdauthor, 'howto') |
| 141 |
for fn in os.listdir('howto') |
| 142 |
if fn.endswith('.rst') and fn != 'index.rst') |
| 143 |
|
| 144 |
|
| 145 |
latex_appendices = ['glossary', 'about', 'license', 'copyright'] |
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
epub_author = 'Python Documentation Authors' |
| 151 |
epub_publisher = 'Python Software Foundation' |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
coverage_ignore_modules = [ |
| 159 |
r'[T|t][k|K]', |
| 160 |
r'Tix', |
| 161 |
r'distutils.*', |
| 162 |
] |
| 163 |
|
| 164 |
coverage_ignore_functions = [ |
| 165 |
'test($|_)', |
| 166 |
] |
| 167 |
|
| 168 |
coverage_ignore_classes = [ |
| 169 |
] |
| 170 |
|
| 171 |
|
| 172 |
coverage_c_path = [ |
| 173 |
'../Include/*.h', |
| 174 |
] |
| 175 |
|
| 176 |
|
| 177 |
coverage_c_regexes = { |
| 178 |
'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'), |
| 179 |
'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'), |
| 180 |
'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'), |
| 181 |
} |
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
coverage_ignore_c_items = { |
| 186 |
|
| 187 |
} |
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
linkcheck_ignore = [r'https://bugs.python.org/(issue)?\d+', |
| 195 |
|
| 196 |
r'http://www.python.org/dev/peps/pep-\d+'] |
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
refcount_file = 'data/refcounts.dat' |