blob: 2be0f19c6d705d87adb521dec55817eb35cff45a [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001# -*- coding: utf-8 -*-
2#
3# Python documentation build configuration file
4#
Christian Heimes679db4a2008-01-18 09:56:22 +00005# This file is execfile()d with the current directory set to its containing dir.
6#
Georg Brandl116aa622007-08-15 14:28:22 +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).
Christian Heimes2c181612007-12-17 20:04:13 +00009
Georg Brandl86def6c2008-01-21 20:36:10 +000010import sys, os, time
Christian Heimes33fe8092008-04-13 13:53:33 +000011sys.path.append(os.path.abspath('tools/sphinxext'))
Georg Brandl86def6c2008-01-21 20:36:10 +000012
Christian Heimes2c181612007-12-17 20:04:13 +000013# General configuration
14# ---------------------
Georg Brandl116aa622007-08-15 14:28:22 +000015
Christian Heimesfe337bf2008-03-23 21:54:12 +000016extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage',
Martin v. Löwis5680d0c2008-04-10 03:06:53 +000017 'sphinx.ext.doctest', 'pyspecific']
Georg Brandl45832ea2008-03-12 08:52:43 +000018templates_path = ['tools/sphinxext']
Christian Heimes26855632008-01-27 23:50:43 +000019
Christian Heimes679db4a2008-01-18 09:56:22 +000020# General substitutions.
21project = 'Python'
Georg Brandl86def6c2008-01-21 20:36:10 +000022copyright = '1990-%s, Python Software Foundation' % time.strftime('%Y')
Christian Heimes679db4a2008-01-18 09:56:22 +000023
Georg Brandl116aa622007-08-15 14:28:22 +000024# The default replacements for |version| and |release|.
Georg Brandl116aa622007-08-15 14:28:22 +000025#
26# The short X.Y version.
27# version = '2.6'
Georg Brandl116aa622007-08-15 14:28:22 +000028# The full version, including alpha/beta/rc tags.
29# release = '2.6a0'
Georg Brandl86def6c2008-01-21 20:36:10 +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 Brandl116aa622007-08-15 14:28:22 +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 Brandl116aa622007-08-15 14:28:22 +000042# List of files that shouldn't be included in the build.
Christian Heimes3feef612008-02-11 06:19:17 +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',
50 'whatsnew/2.6',
51 'maclib/scrap',
52 'library/xmllib',
53 'library/xml.etree',
Georg Brandl116aa622007-08-15 14:28:22 +000054]
55
Christian Heimes679db4a2008-01-18 09:56:22 +000056# Relative filename of the reference count data file.
57refcount_file = 'data/refcounts.dat'
58
Georg Brandl116aa622007-08-15 14:28:22 +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
Christian Heimes2c181612007-12-17 20:04:13 +000065
Georg Brandl64063702008-09-09 19:10:58 +000066# By default, highlight as Python 3.
67highlight_language = 'python3'
68
Christian Heimes2c181612007-12-17 20:04:13 +000069
70# Options for HTML output
71# -----------------------
72
Christian Heimes2c181612007-12-17 20:04:13 +000073# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
74# using the given strftime format.
75html_last_updated_fmt = '%b %d, %Y'
76
77# If true, SmartyPants will be used to convert quotes and dashes to
78# typographically correct entities.
79html_use_smartypants = True
80
Christian Heimes679db4a2008-01-18 09:56:22 +000081# Custom sidebar templates, filenames relative to this file.
82html_sidebars = {
Georg Brandl45832ea2008-03-12 08:52:43 +000083 'index': 'indexsidebar.html',
Christian Heimes679db4a2008-01-18 09:56:22 +000084}
85
86# Additional templates that should be rendered to pages.
87html_additional_pages = {
Georg Brandl45832ea2008-03-12 08:52:43 +000088 'download': 'download.html',
Christian Heimesa342c012008-04-20 21:01:16 +000089 'index': 'indexcontent.html',
Christian Heimes679db4a2008-01-18 09:56:22 +000090}
91
Georg Brandle7570052008-05-03 20:52:18 +000092# Output an OpenSearch description file.
93html_use_opensearch = 'http://docs.python.org/dev/3.0'
94
95# Additional static files.
96html_static_path = ['tools/sphinxext/static']
97
Christian Heimes679db4a2008-01-18 09:56:22 +000098# Output file base name for HTML help builder.
Christian Heimesb558a2e2008-03-02 22:46:37 +000099htmlhelp_basename = 'python' + release.replace('.', '')
Christian Heimes679db4a2008-01-18 09:56:22 +0000100
Amaury Forgeot d'Arc35c86582008-06-17 21:11:29 +0000101# Split the index
102html_split_index = True
103
Christian Heimes2c181612007-12-17 20:04:13 +0000104
105# Options for LaTeX output
106# ------------------------
107
Christian Heimes679db4a2008-01-18 09:56:22 +0000108# The paper size ('letter' or 'a4').
109latex_paper_size = 'a4'
Christian Heimes2c181612007-12-17 20:04:13 +0000110
Christian Heimes679db4a2008-01-18 09:56:22 +0000111# The font size ('10pt', '11pt' or '12pt').
112latex_font_size = '10pt'
113
114# Grouping the document tree into LaTeX files. List of tuples
115# (source start file, target name, title, author, document class [howto/manual]).
116_stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor'
117latex_documents = [
Christian Heimes292d3512008-02-03 16:51:08 +0000118 ('c-api/index', 'c-api.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000119 'The Python/C API', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000120 ('distutils/index', 'distutils.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000121 'Distributing Python Modules', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000122 ('documenting/index', 'documenting.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000123 'Documenting Python', 'Georg Brandl', 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000124 ('extending/index', 'extending.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000125 'Extending and Embedding Python', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000126 ('install/index', 'install.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000127 'Installing Python Modules', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000128 ('library/index', 'library.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000129 'The Python Library Reference', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000130 ('reference/index', 'reference.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000131 'The Python Language Reference', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000132 ('tutorial/index', 'tutorial.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000133 'Python Tutorial', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000134 ('using/index', 'using.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000135 'Using Python', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000136 ('whatsnew/' + version, 'whatsnew.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000137 'What\'s New in Python', 'A. M. Kuchling', 'howto'),
138]
139# Collect all HOWTOs individually
Christian Heimes292d3512008-02-03 16:51:08 +0000140latex_documents.extend(('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000141 'HOWTO', _stdauthor, 'howto')
142 for fn in os.listdir('howto')
143 if fn.endswith('.rst') and fn != 'index.rst')
144
145# Additional stuff for the LaTeX preamble.
146latex_preamble = r'''
147\authoraddress{
148 \strong{Python Software Foundation}\\
149 Email: \email{docs@python.org}
150}
151'''
152
153# Documents to append as an appendix to all manuals.
Christian Heimes292d3512008-02-03 16:51:08 +0000154latex_appendices = ['glossary', 'about', 'license', 'copyright']
Christian Heimesd3eb5a152008-02-24 00:38:49 +0000155
156# Options for the coverage checker
157# --------------------------------
158
159# The coverage checker will ignore all modules/functions/classes whose names
160# match any of the following regexes (using re.match).
161coverage_ignore_modules = [
162 r'[T|t][k|K]',
163 r'Tix',
164 r'distutils.*',
165]
166
167coverage_ignore_functions = [
168 'test($|_)',
169]
170
171coverage_ignore_classes = [
172]
173
174# Glob patterns for C source files for C API coverage, relative to this directory.
175coverage_c_path = [
176 '../Include/*.h',
177]
178
179# Regexes to find C items in the source files.
180coverage_c_regexes = {
181 'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'),
182 'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'),
183 'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'),
184}
185
186# The coverage checker will ignore all C items whose names match these regexes
187# (using re.match) -- the keys must be the same as in coverage_c_regexes.
188coverage_ignore_c_items = {
189# 'cfunction': [...]
190}