blob: c9f91149289956c6b98ddef8681387254a613762 [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
66
67# Options for HTML output
68# -----------------------
69
Christian Heimes2c181612007-12-17 20:04:13 +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
Christian Heimes679db4a2008-01-18 09:56:22 +000078# Content template for the index page, filename relative to this file.
Georg Brandl45832ea2008-03-12 08:52:43 +000079html_index = 'indexcontent.html'
Christian Heimes679db4a2008-01-18 09:56:22 +000080
81# 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 Heimes679db4a2008-01-18 09:56:22 +000089}
90
91# Output file base name for HTML help builder.
Christian Heimesb558a2e2008-03-02 22:46:37 +000092htmlhelp_basename = 'python' + release.replace('.', '')
Christian Heimes679db4a2008-01-18 09:56:22 +000093
Christian Heimes2c181612007-12-17 20:04:13 +000094
95# Options for LaTeX output
96# ------------------------
97
Christian Heimes679db4a2008-01-18 09:56:22 +000098# The paper size ('letter' or 'a4').
99latex_paper_size = 'a4'
Christian Heimes2c181612007-12-17 20:04:13 +0000100
Christian Heimes679db4a2008-01-18 09:56:22 +0000101# The font size ('10pt', '11pt' or '12pt').
102latex_font_size = '10pt'
103
104# Grouping the document tree into LaTeX files. List of tuples
105# (source start file, target name, title, author, document class [howto/manual]).
106_stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor'
107latex_documents = [
Christian Heimes292d3512008-02-03 16:51:08 +0000108 ('c-api/index', 'c-api.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000109 'The Python/C API', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000110 ('distutils/index', 'distutils.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000111 'Distributing Python Modules', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000112 ('documenting/index', 'documenting.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000113 'Documenting Python', 'Georg Brandl', 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000114 ('extending/index', 'extending.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000115 'Extending and Embedding Python', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000116 ('install/index', 'install.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000117 'Installing Python Modules', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000118 ('library/index', 'library.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000119 'The Python Library Reference', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000120 ('reference/index', 'reference.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000121 'The Python Language Reference', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000122 ('tutorial/index', 'tutorial.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000123 'Python Tutorial', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000124 ('using/index', 'using.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000125 'Using Python', _stdauthor, 'manual'),
Christian Heimes292d3512008-02-03 16:51:08 +0000126 ('whatsnew/' + version, 'whatsnew.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000127 'What\'s New in Python', 'A. M. Kuchling', 'howto'),
128]
129# Collect all HOWTOs individually
Christian Heimes292d3512008-02-03 16:51:08 +0000130latex_documents.extend(('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex',
Christian Heimes679db4a2008-01-18 09:56:22 +0000131 'HOWTO', _stdauthor, 'howto')
132 for fn in os.listdir('howto')
133 if fn.endswith('.rst') and fn != 'index.rst')
134
135# Additional stuff for the LaTeX preamble.
136latex_preamble = r'''
137\authoraddress{
138 \strong{Python Software Foundation}\\
139 Email: \email{docs@python.org}
140}
141'''
142
143# Documents to append as an appendix to all manuals.
Christian Heimes292d3512008-02-03 16:51:08 +0000144latex_appendices = ['glossary', 'about', 'license', 'copyright']
Christian Heimesd3eb5a152008-02-24 00:38:49 +0000145
146# Options for the coverage checker
147# --------------------------------
148
149# The coverage checker will ignore all modules/functions/classes whose names
150# match any of the following regexes (using re.match).
151coverage_ignore_modules = [
152 r'[T|t][k|K]',
153 r'Tix',
154 r'distutils.*',
155]
156
157coverage_ignore_functions = [
158 'test($|_)',
159]
160
161coverage_ignore_classes = [
162]
163
164# Glob patterns for C source files for C API coverage, relative to this directory.
165coverage_c_path = [
166 '../Include/*.h',
167]
168
169# Regexes to find C items in the source files.
170coverage_c_regexes = {
171 'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'),
172 'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'),
173 'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'),
174}
175
176# The coverage checker will ignore all C items whose names match these regexes
177# (using re.match) -- the keys must be the same as in coverage_c_regexes.
178coverage_ignore_c_items = {
179# 'cfunction': [...]
180}