Merged revisions 75928 via svnmerge from
[python/dscho.git] / Doc / conf.py
blobe2b0ce0370aa807c219302ff9c9a32fb7ce5cd02
1 # -*- coding: utf-8 -*-
3 # Python documentation build configuration file
5 # This file is execfile()d with the current directory set to its containing dir.
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).
10 import sys, os, time
11 sys.path.append(os.path.abspath('tools/sphinxext'))
13 # General configuration
14 # ---------------------
16 extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage',
17 'sphinx.ext.doctest', 'pyspecific']
18 templates_path = ['tools/sphinxext']
20 # General substitutions.
21 project = 'Python'
22 copyright = '1990-%s, Python Software Foundation' % time.strftime('%Y')
24 # The default replacements for |version| and |release|.
26 # The short X.Y version.
27 # version = '2.6'
28 # The full version, including alpha/beta/rc tags.
29 # release = '2.6a0'
31 # We look for the Include/patchlevel.h file in the current Python source tree
32 # and replace the values accordingly.
33 import patchlevel
34 version, release = patchlevel.get_version_info()
36 # There are two options for replacing |today|: either, you set today to some
37 # non-false value, then it is used:
38 today = ''
39 # Else, today_fmt is used as the format for a strftime call.
40 today_fmt = '%B %d, %Y'
42 # List of files that shouldn't be included in the build.
43 unused_docs = [
44 'maclib/scrap',
45 'library/xmllib',
46 'library/xml.etree',
49 # Ignore .rst in Sphinx its self.
50 exclude_trees = ['tools/sphinx']
52 # Relative filename of the reference count data file.
53 refcount_file = 'data/refcounts.dat'
55 # If true, '()' will be appended to :func: etc. cross-reference text.
56 add_function_parentheses = True
58 # If true, the current module name will be prepended to all description
59 # unit titles (such as .. function::).
60 add_module_names = True
62 # By default, highlight as Python 3.
63 highlight_language = 'python3'
66 # Options for HTML output
67 # -----------------------
69 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
70 # using the given strftime format.
71 html_last_updated_fmt = '%b %d, %Y'
73 # If true, SmartyPants will be used to convert quotes and dashes to
74 # typographically correct entities.
75 html_use_smartypants = True
77 # Custom sidebar templates, filenames relative to this file.
78 html_sidebars = {
79 'index': 'indexsidebar.html',
82 # Additional templates that should be rendered to pages.
83 html_additional_pages = {
84 'download': 'download.html',
85 'index': 'indexcontent.html',
88 # Output an OpenSearch description file.
89 html_use_opensearch = 'http://docs.python.org/3.1'
91 # Additional static files.
92 html_static_path = ['tools/sphinxext/static']
94 # Output file base name for HTML help builder.
95 htmlhelp_basename = 'python' + release.replace('.', '')
97 # Split the index
98 html_split_index = True
101 # Options for LaTeX output
102 # ------------------------
104 # The paper size ('letter' or 'a4').
105 latex_paper_size = 'a4'
107 # The font size ('10pt', '11pt' or '12pt').
108 latex_font_size = '10pt'
110 # Grouping the document tree into LaTeX files. List of tuples
111 # (source start file, target name, title, author, document class [howto/manual]).
112 _stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor'
113 latex_documents = [
114 ('c-api/index', 'c-api.tex',
115 'The Python/C API', _stdauthor, 'manual'),
116 ('distutils/index', 'distutils.tex',
117 'Distributing Python Modules', _stdauthor, 'manual'),
118 ('documenting/index', 'documenting.tex',
119 'Documenting Python', 'Georg Brandl', 'manual'),
120 ('extending/index', 'extending.tex',
121 'Extending and Embedding Python', _stdauthor, 'manual'),
122 ('install/index', 'install.tex',
123 'Installing Python Modules', _stdauthor, 'manual'),
124 ('library/index', 'library.tex',
125 'The Python Library Reference', _stdauthor, 'manual'),
126 ('reference/index', 'reference.tex',
127 'The Python Language Reference', _stdauthor, 'manual'),
128 ('tutorial/index', 'tutorial.tex',
129 'Python Tutorial', _stdauthor, 'manual'),
130 ('using/index', 'using.tex',
131 'Using Python', _stdauthor, 'manual'),
132 ('whatsnew/' + version, 'whatsnew.tex',
133 'What\'s New in Python', 'A. M. Kuchling', 'howto'),
135 # Collect all HOWTOs individually
136 latex_documents.extend(('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex',
137 '', _stdauthor, 'howto')
138 for fn in os.listdir('howto')
139 if fn.endswith('.rst') and fn != 'index.rst')
141 # Additional stuff for the LaTeX preamble.
142 latex_preamble = r'''
143 \authoraddress{
144 \strong{Python Software Foundation}\\
145 Email: \email{docs@python.org}
147 \let\Verbatim=\OriginalVerbatim
148 \let\endVerbatim=\endOriginalVerbatim
151 # Documents to append as an appendix to all manuals.
152 latex_appendices = ['glossary', 'about', 'license', 'copyright']
154 # Get LaTeX to handle Unicode correctly
155 latex_elements = {'inputenc': r'\usepackage[utf8x]{inputenc}'}
157 # Options for the coverage checker
158 # --------------------------------
160 # The coverage checker will ignore all modules/functions/classes whose names
161 # match any of the following regexes (using re.match).
162 coverage_ignore_modules = [
163 r'[T|t][k|K]',
164 r'Tix',
165 r'distutils.*',
168 coverage_ignore_functions = [
169 'test($|_)',
172 coverage_ignore_classes = [
175 # Glob patterns for C source files for C API coverage, relative to this directory.
176 coverage_c_path = [
177 '../Include/*.h',
180 # Regexes to find C items in the source files.
181 coverage_c_regexes = {
182 'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'),
183 'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'),
184 'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'),
187 # The coverage checker will ignore all C items whose names match these regexes
188 # (using re.match) -- the keys must be the same as in coverage_c_regexes.
189 coverage_ignore_c_items = {
190 # 'cfunction': [...]