Debian Codegraph @

cpython27/Doc/conf.py

raw symbols SCIP
1 # -*- coding: utf-8 -*-
2 #
3 # Python documentation build configuration file
4 #
5 # This file is execfile()d with the current directory set to its containing dir.
6 #
7 # The contents of this file are pickled, so don't put values in the namespace
8 # that aren't pickleable (module imports are okay, they're removed automatically).
9
10 import sys, os, time
11 sys.path.append(os.path.abspath('tools/extensions'))
12
13 # General configuration
14 # ---------------------
15
16 extensions = ['sphinx.ext.coverage', 'sphinx.ext.doctest',
17 'pyspecific', 'c_annotations']
18
19 # General substitutions.
20 project = 'Python'
21 copyright = '1990-%s, Python Software Foundation' % time.strftime('%Y')
22
23 # We look for the Include/patchlevel.h file in the current Python source tree
24 # and replace the values accordingly.
25 import patchlevel
26 version, release = patchlevel.get_version_info()
27
28 # There are two options for replacing |today|: either, you set today to some
29 # non-false value, then it is used:
30 today = ''
31 # Else, today_fmt is used as the format for a strftime call.
32 today_fmt = '%B %d, %Y'
33
34 # List of files that shouldn't be included in the build.
35 exclude_patterns = [
36 'maclib/scrap.rst',
37 'library/xmllib.rst',
38 'library/xml.etree.rst',
39 ]
40
41 # Require Sphinx 1.2 for build.
42 needs_sphinx = '1.2'
43
44 # Avoid a warning with Sphinx >= 2.0
45 master_doc = 'contents'
46
47 # Options for HTML output
48 # -----------------------
49
50 html_theme = 'default'
51 html_theme_options = {'collapsiblesidebar': True}
52
53 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
54 # using the given strftime format.
55 html_last_updated_fmt = '%b %d, %Y'
56
57 # Path to find HTML templates.
58 templates_path = ['tools/templates']
59
60 # Custom sidebar templates, filenames relative to this file.
61 html_sidebars = {
62 'index': ['indexsidebar.html'],
63 }
64
65 # Additional templates that should be rendered to pages.
66 html_additional_pages = {
67 'download': 'download.html',
68 'index': 'indexcontent.html',
69 }
70
71 # Output an OpenSearch description file.
72 html_use_opensearch = 'https://docs.python.org/'
73
74 # Additional static files.
75 html_static_path = ['tools/static']
76
77 # Output file base name for HTML help builder.
78 htmlhelp_basename = 'python' + release.replace('.', '')
79
80 # Split the index
81 html_split_index = True
82
83 html_context = {
84 'outdated': True
85 }
86
87
88 # Options for LaTeX output
89 # ------------------------
90
91 latex_engine = 'xelatex'
92
93 # Get LaTeX to handle Unicode correctly
94 latex_elements = {
95 }
96
97 # Additional stuff for the LaTeX preamble.
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 # The paper size ('letter' or 'a4').
108 latex_elements['papersize'] = 'a4'
109
110 # The font size ('10pt', '11pt' or '12pt').
111 latex_elements['pointsize'] = '10pt'
112
113 # Grouping the document tree into LaTeX files. List of tuples
114 # (source start file, target name, title, author, document class [howto/manual]).
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 # Collect all HOWTOs individually
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 # Documents to append as an appendix to all manuals.
145 latex_appendices = ['glossary', 'about', 'license', 'copyright']
146
147 # Options for Epub output
148 # -----------------------
149
150 epub_author = 'Python Documentation Authors'
151 epub_publisher = 'Python Software Foundation'
152
153 # Options for the coverage checker
154 # --------------------------------
155
156 # The coverage checker will ignore all modules/functions/classes whose names
157 # match any of the following regexes (using re.match).
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 # Glob patterns for C source files for C API coverage, relative to this directory.
172 coverage_c_path = [
173 '../Include/*.h',
174 ]
175
176 # Regexes to find C items in the source files.
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 # The coverage checker will ignore all C items whose names match these regexes
184 # (using re.match) -- the keys must be the same as in coverage_c_regexes.
185 coverage_ignore_c_items = {
186 # 'cfunction': [...]
187 }
188
189
190 # Options for the link checker
191 # ----------------------------
192
193 # Ignore certain URLs.
194 linkcheck_ignore = [r'https://bugs.python.org/(issue)?\d+',
195 # Ignore PEPs for now, they all have permanent redirects.
196 r'http://www.python.org/dev/peps/pep-\d+']
197
198
199 # Options for extensions
200 # ----------------------
201
202 # Relative filename of the reference count data file.
203 refcount_file = 'data/refcounts.dat'