blob: c718d8b4322fbb073c1809e52ba224c68812fa1e [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
11sys.path.append('tools/sphinxext')
12
Georg Brandleee1fc52007-12-16 19:36:51 +000013# General configuration
14# ---------------------
Georg Brandl8ec7f652007-08-15 14:28:01 +000015
Georg Brandl976a0592008-02-25 20:17:56 +000016extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage']
Georg Brandl56eadd92008-01-27 20:25:12 +000017
Georg Brandl7155a092008-01-16 20:27:56 +000018# General substitutions.
19project = 'Python'
Georg Brandldd76e052008-01-21 20:20:53 +000020copyright = '1990-%s, Python Software Foundation' % time.strftime('%Y')
Georg Brandl7155a092008-01-16 20:27:56 +000021
Georg Brandl8ec7f652007-08-15 14:28:01 +000022# The default replacements for |version| and |release|.
Georg Brandl8ec7f652007-08-15 14:28:01 +000023#
24# The short X.Y version.
25# version = '2.6'
Georg Brandl8ec7f652007-08-15 14:28:01 +000026# The full version, including alpha/beta/rc tags.
27# release = '2.6a0'
Georg Brandldd76e052008-01-21 20:20:53 +000028
29# We look for the Include/patchlevel.h file in the current Python source tree
30# and replace the values accordingly.
31import patchlevel
32version, release = patchlevel.get_version_info()
Georg Brandl8ec7f652007-08-15 14:28:01 +000033
34# There are two options for replacing |today|: either, you set today to some
35# non-false value, then it is used:
36today = ''
37# Else, today_fmt is used as the format for a strftime call.
38today_fmt = '%B %d, %Y'
39
Georg Brandl8ec7f652007-08-15 14:28:01 +000040# List of files that shouldn't be included in the build.
Georg Brandl14a1b8c2008-02-09 23:09:25 +000041unused_docs = [
42 'whatsnew/2.0',
43 'whatsnew/2.1',
44 'whatsnew/2.2',
45 'whatsnew/2.3',
46 'whatsnew/2.4',
47 'whatsnew/2.5',
48 'maclib/scrap',
49 'library/xmllib',
50 'library/xml.etree',
Georg Brandl8ec7f652007-08-15 14:28:01 +000051]
52
Georg Brandl7155a092008-01-16 20:27:56 +000053# Relative filename of the reference count data file.
54refcount_file = 'data/refcounts.dat'
55
Georg Brandl8ec7f652007-08-15 14:28:01 +000056# If true, '()' will be appended to :func: etc. cross-reference text.
57add_function_parentheses = True
58
59# If true, the current module name will be prepended to all description
60# unit titles (such as .. function::).
61add_module_names = True
Georg Brandleee1fc52007-12-16 19:36:51 +000062
63
64# Options for HTML output
65# -----------------------
66
Georg Brandleee1fc52007-12-16 19:36:51 +000067# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
68# using the given strftime format.
69html_last_updated_fmt = '%b %d, %Y'
70
71# If true, SmartyPants will be used to convert quotes and dashes to
72# typographically correct entities.
73html_use_smartypants = True
74
Georg Brandl7155a092008-01-16 20:27:56 +000075# Content template for the index page, filename relative to this file.
76html_index = 'tools/sphinxext/indexcontent.html'
77
78# Custom sidebar templates, filenames relative to this file.
79html_sidebars = {
80 'index': 'tools/sphinxext/indexsidebar.html',
81}
82
83# Additional templates that should be rendered to pages.
84html_additional_pages = {
85 'download': 'tools/sphinxext/download.html',
86}
87
88# Output file base name for HTML help builder.
Georg Brandl47dff402008-03-02 06:45:40 +000089htmlhelp_basename = 'python' + release.replace('.', '')
Georg Brandl7155a092008-01-16 20:27:56 +000090
Georg Brandleee1fc52007-12-16 19:36:51 +000091
92# Options for LaTeX output
93# ------------------------
94
Georg Brandl7155a092008-01-16 20:27:56 +000095# The paper size ('letter' or 'a4').
96latex_paper_size = 'a4'
Georg Brandleee1fc52007-12-16 19:36:51 +000097
Georg Brandl7155a092008-01-16 20:27:56 +000098# The font size ('10pt', '11pt' or '12pt').
99latex_font_size = '10pt'
100
101# Grouping the document tree into LaTeX files. List of tuples
102# (source start file, target name, title, author, document class [howto/manual]).
103_stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor'
104latex_documents = [
Georg Brandla51f61b2008-02-01 20:45:33 +0000105 ('c-api/index', 'c-api.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000106 'The Python/C API', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000107 ('distutils/index', 'distutils.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000108 'Distributing Python Modules', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000109 ('documenting/index', 'documenting.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000110 'Documenting Python', 'Georg Brandl', 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000111 ('extending/index', 'extending.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000112 'Extending and Embedding Python', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000113 ('install/index', 'install.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000114 'Installing Python Modules', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000115 ('library/index', 'library.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000116 'The Python Library Reference', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000117 ('reference/index', 'reference.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000118 'The Python Language Reference', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000119 ('tutorial/index', 'tutorial.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000120 'Python Tutorial', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000121 ('using/index', 'using.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000122 'Using Python', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000123 ('whatsnew/' + version, 'whatsnew.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000124 'What\'s New in Python', 'A. M. Kuchling', 'howto'),
125]
126# Collect all HOWTOs individually
Georg Brandla51f61b2008-02-01 20:45:33 +0000127latex_documents.extend(('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000128 'HOWTO', _stdauthor, 'howto')
129 for fn in os.listdir('howto')
130 if fn.endswith('.rst') and fn != 'index.rst')
131
132# Additional stuff for the LaTeX preamble.
133latex_preamble = r'''
134\authoraddress{
135 \strong{Python Software Foundation}\\
136 Email: \email{docs@python.org}
137}
138'''
139
140# Documents to append as an appendix to all manuals.
Georg Brandla51f61b2008-02-01 20:45:33 +0000141latex_appendices = ['glossary', 'about', 'license', 'copyright']
Georg Brandl17048282008-02-23 18:47:04 +0000142
143# Options for the coverage checker
144# --------------------------------
145
146# The coverage checker will ignore all modules/functions/classes whose names
147# match any of the following regexes (using re.match).
148coverage_ignore_modules = [
149 r'[T|t][k|K]',
150 r'Tix',
151 r'distutils.*',
152]
153
154coverage_ignore_functions = [
155 'test($|_)',
156]
157
158coverage_ignore_classes = [
159]
160
161# Glob patterns for C source files for C API coverage, relative to this directory.
162coverage_c_path = [
163 '../Include/*.h',
164]
165
166# Regexes to find C items in the source files.
167coverage_c_regexes = {
168 'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'),
169 'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'),
170 'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'),
171}
172
173# The coverage checker will ignore all C items whose names match these regexes
174# (using re.match) -- the keys must be the same as in coverage_c_regexes.
175coverage_ignore_c_items = {
176# 'cfunction': [...]
177}