blob: d6bf613d8e073184086433d99f6e9ccbdb1c98f1 [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +00001# -*- coding: utf-8 -*-
2#
3# Python documentation build configuration file
4#
Georg Brandl7155a092008-01-16 20:27:56 +00005# This file is execfile()d with the current directory set to its containing dir.
6#
Georg Brandl8ec7f652007-08-15 14:28:01 +00007# 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).
Georg Brandleee1fc52007-12-16 19:36:51 +00009
Georg Brandldd76e052008-01-21 20:20:53 +000010import sys, os, time
Georg Brandlb4d21132008-04-12 18:11:18 +000011sys.path.append(os.path.abspath('tools/sphinxext'))
Georg Brandldd76e052008-01-21 20:20:53 +000012
Georg Brandleee1fc52007-12-16 19:36:51 +000013# General configuration
14# ---------------------
Georg Brandl8ec7f652007-08-15 14:28:01 +000015
Georg Brandl17baef02008-03-22 10:56:23 +000016extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage',
Georg Brandlc3051922008-04-09 17:58:56 +000017 'sphinx.ext.doctest', 'pyspecific']
Georg Brandl5bb647d2008-03-09 18:18:30 +000018templates_path = ['tools/sphinxext']
Georg Brandl56eadd92008-01-27 20:25:12 +000019
Georg Brandl7155a092008-01-16 20:27:56 +000020# General substitutions.
21project = 'Python'
Georg Brandldd76e052008-01-21 20:20:53 +000022copyright = '1990-%s, Python Software Foundation' % time.strftime('%Y')
Georg Brandl7155a092008-01-16 20:27:56 +000023
Georg Brandl8ec7f652007-08-15 14:28:01 +000024# The default replacements for |version| and |release|.
Georg Brandl8ec7f652007-08-15 14:28:01 +000025#
26# The short X.Y version.
27# version = '2.6'
Georg Brandl8ec7f652007-08-15 14:28:01 +000028# The full version, including alpha/beta/rc tags.
29# release = '2.6a0'
Georg Brandldd76e052008-01-21 20:20:53 +000030
31# We look for the Include/patchlevel.h file in the current Python source tree
32# and replace the values accordingly.
33import patchlevel
34version, release = patchlevel.get_version_info()
Georg Brandl8ec7f652007-08-15 14:28:01 +000035
36# There are two options for replacing |today|: either, you set today to some
37# non-false value, then it is used:
38today = ''
39# Else, today_fmt is used as the format for a strftime call.
40today_fmt = '%B %d, %Y'
41
Georg Brandl8ec7f652007-08-15 14:28:01 +000042# List of files that shouldn't be included in the build.
Georg Brandl14a1b8c2008-02-09 23:09:25 +000043unused_docs = [
44 'whatsnew/2.0',
45 'whatsnew/2.1',
46 'whatsnew/2.2',
47 'whatsnew/2.3',
48 'whatsnew/2.4',
49 'whatsnew/2.5',
Benjamin Petersone6555dd2008-10-04 17:10:14 +000050 'whatsnew/2.6',
Georg Brandl14a1b8c2008-02-09 23:09:25 +000051 'maclib/scrap',
52 'library/xmllib',
53 'library/xml.etree',
Georg Brandl8ec7f652007-08-15 14:28:01 +000054]
55
Georg Brandl7155a092008-01-16 20:27:56 +000056# Relative filename of the reference count data file.
57refcount_file = 'data/refcounts.dat'
58
Georg Brandl8ec7f652007-08-15 14:28:01 +000059# If true, '()' will be appended to :func: etc. cross-reference text.
60add_function_parentheses = True
61
62# If true, the current module name will be prepended to all description
63# unit titles (such as .. function::).
64add_module_names = True
Georg Brandleee1fc52007-12-16 19:36:51 +000065
66
67# Options for HTML output
68# -----------------------
69
Georg Brandleee1fc52007-12-16 19:36:51 +000070# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
71# using the given strftime format.
72html_last_updated_fmt = '%b %d, %Y'
73
74# If true, SmartyPants will be used to convert quotes and dashes to
75# typographically correct entities.
76html_use_smartypants = True
77
Georg Brandl7155a092008-01-16 20:27:56 +000078# Custom sidebar templates, filenames relative to this file.
79html_sidebars = {
Georg Brandl5bb647d2008-03-09 18:18:30 +000080 'index': 'indexsidebar.html',
Georg Brandl7155a092008-01-16 20:27:56 +000081}
82
83# Additional templates that should be rendered to pages.
84html_additional_pages = {
Georg Brandl5bb647d2008-03-09 18:18:30 +000085 'download': 'download.html',
Georg Brandl1df986b2008-04-19 21:28:38 +000086 'index': 'indexcontent.html',
Georg Brandl7155a092008-01-16 20:27:56 +000087}
88
Georg Brandl4f1f36b2008-04-27 20:03:05 +000089# Output an OpenSearch description file.
Georg Brandl761b9c62008-05-03 20:16:47 +000090html_use_opensearch = 'http://docs.python.org/dev'
Georg Brandl4f1f36b2008-04-27 20:03:05 +000091
92# Additional static files.
93html_static_path = ['tools/sphinxext/static']
94
Georg Brandl7155a092008-01-16 20:27:56 +000095# Output file base name for HTML help builder.
Georg Brandl47dff402008-03-02 06:45:40 +000096htmlhelp_basename = 'python' + release.replace('.', '')
Georg Brandl7155a092008-01-16 20:27:56 +000097
Georg Brandl5c15aba2008-06-17 09:01:35 +000098# Split the index
99html_split_index = True
100
Georg Brandleee1fc52007-12-16 19:36:51 +0000101
102# Options for LaTeX output
103# ------------------------
104
Georg Brandl7155a092008-01-16 20:27:56 +0000105# The paper size ('letter' or 'a4').
106latex_paper_size = 'a4'
Georg Brandleee1fc52007-12-16 19:36:51 +0000107
Georg Brandl7155a092008-01-16 20:27:56 +0000108# The font size ('10pt', '11pt' or '12pt').
109latex_font_size = '10pt'
110
111# Grouping the document tree into LaTeX files. List of tuples
112# (source start file, target name, title, author, document class [howto/manual]).
113_stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor'
114latex_documents = [
Georg Brandla51f61b2008-02-01 20:45:33 +0000115 ('c-api/index', 'c-api.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000116 'The Python/C API', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000117 ('distutils/index', 'distutils.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000118 'Distributing Python Modules', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000119 ('documenting/index', 'documenting.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000120 'Documenting Python', 'Georg Brandl', 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000121 ('extending/index', 'extending.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000122 'Extending and Embedding Python', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000123 ('install/index', 'install.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000124 'Installing Python Modules', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000125 ('library/index', 'library.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000126 'The Python Library Reference', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000127 ('reference/index', 'reference.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000128 'The Python Language Reference', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000129 ('tutorial/index', 'tutorial.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000130 'Python Tutorial', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000131 ('using/index', 'using.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000132 'Using Python', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000133 ('whatsnew/' + version, 'whatsnew.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000134 'What\'s New in Python', 'A. M. Kuchling', 'howto'),
135]
136# Collect all HOWTOs individually
Georg Brandla51f61b2008-02-01 20:45:33 +0000137latex_documents.extend(('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000138 'HOWTO', _stdauthor, 'howto')
139 for fn in os.listdir('howto')
140 if fn.endswith('.rst') and fn != 'index.rst')
141
142# Additional stuff for the LaTeX preamble.
143latex_preamble = r'''
144\authoraddress{
145 \strong{Python Software Foundation}\\
146 Email: \email{docs@python.org}
147}
148'''
149
150# Documents to append as an appendix to all manuals.
Georg Brandla51f61b2008-02-01 20:45:33 +0000151latex_appendices = ['glossary', 'about', 'license', 'copyright']
Georg Brandl17048282008-02-23 18:47:04 +0000152
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).
158coverage_ignore_modules = [
159 r'[T|t][k|K]',
160 r'Tix',
161 r'distutils.*',
162]
163
164coverage_ignore_functions = [
165 'test($|_)',
166]
167
168coverage_ignore_classes = [
169]
170
171# Glob patterns for C source files for C API coverage, relative to this directory.
172coverage_c_path = [
173 '../Include/*.h',
174]
175
176# Regexes to find C items in the source files.
177coverage_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.
185coverage_ignore_c_items = {
186# 'cfunction': [...]
187}