blob: f6c08c517862968fe94013e2db56d3a9c45d8b5d [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 Brandl17baef02008-03-22 10:56:23 +000016extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage',
17 'sphinx.ext.doctest']
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',
50 'maclib/scrap',
51 'library/xmllib',
52 'library/xml.etree',
Georg Brandl8ec7f652007-08-15 14:28:01 +000053]
54
Georg Brandl7155a092008-01-16 20:27:56 +000055# Relative filename of the reference count data file.
56refcount_file = 'data/refcounts.dat'
57
Georg Brandl8ec7f652007-08-15 14:28:01 +000058# If true, '()' will be appended to :func: etc. cross-reference text.
59add_function_parentheses = True
60
61# If true, the current module name will be prepended to all description
62# unit titles (such as .. function::).
63add_module_names = True
Georg Brandleee1fc52007-12-16 19:36:51 +000064
65
66# Options for HTML output
67# -----------------------
68
Georg Brandleee1fc52007-12-16 19:36:51 +000069# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
70# using the given strftime format.
71html_last_updated_fmt = '%b %d, %Y'
72
73# If true, SmartyPants will be used to convert quotes and dashes to
74# typographically correct entities.
75html_use_smartypants = True
76
Georg Brandl7155a092008-01-16 20:27:56 +000077# Content template for the index page, filename relative to this file.
Georg Brandl5bb647d2008-03-09 18:18:30 +000078html_index = 'indexcontent.html'
Georg Brandl7155a092008-01-16 20:27:56 +000079
80# Custom sidebar templates, filenames relative to this file.
81html_sidebars = {
Georg Brandl5bb647d2008-03-09 18:18:30 +000082 'index': 'indexsidebar.html',
Georg Brandl7155a092008-01-16 20:27:56 +000083}
84
85# Additional templates that should be rendered to pages.
86html_additional_pages = {
Georg Brandl5bb647d2008-03-09 18:18:30 +000087 'download': 'download.html',
Georg Brandl7155a092008-01-16 20:27:56 +000088}
89
90# Output file base name for HTML help builder.
Georg Brandl47dff402008-03-02 06:45:40 +000091htmlhelp_basename = 'python' + release.replace('.', '')
Georg Brandl7155a092008-01-16 20:27:56 +000092
Georg Brandleee1fc52007-12-16 19:36:51 +000093
94# Options for LaTeX output
95# ------------------------
96
Georg Brandl7155a092008-01-16 20:27:56 +000097# The paper size ('letter' or 'a4').
98latex_paper_size = 'a4'
Georg Brandleee1fc52007-12-16 19:36:51 +000099
Georg Brandl7155a092008-01-16 20:27:56 +0000100# The font size ('10pt', '11pt' or '12pt').
101latex_font_size = '10pt'
102
103# Grouping the document tree into LaTeX files. List of tuples
104# (source start file, target name, title, author, document class [howto/manual]).
105_stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor'
106latex_documents = [
Georg Brandla51f61b2008-02-01 20:45:33 +0000107 ('c-api/index', 'c-api.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000108 'The Python/C API', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000109 ('distutils/index', 'distutils.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000110 'Distributing Python Modules', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000111 ('documenting/index', 'documenting.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000112 'Documenting Python', 'Georg Brandl', 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000113 ('extending/index', 'extending.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000114 'Extending and Embedding Python', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000115 ('install/index', 'install.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000116 'Installing Python Modules', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000117 ('library/index', 'library.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000118 'The Python Library Reference', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000119 ('reference/index', 'reference.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000120 'The Python Language Reference', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000121 ('tutorial/index', 'tutorial.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000122 'Python Tutorial', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000123 ('using/index', 'using.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000124 'Using Python', _stdauthor, 'manual'),
Georg Brandla51f61b2008-02-01 20:45:33 +0000125 ('whatsnew/' + version, 'whatsnew.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000126 'What\'s New in Python', 'A. M. Kuchling', 'howto'),
127]
128# Collect all HOWTOs individually
Georg Brandla51f61b2008-02-01 20:45:33 +0000129latex_documents.extend(('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex',
Georg Brandl7155a092008-01-16 20:27:56 +0000130 'HOWTO', _stdauthor, 'howto')
131 for fn in os.listdir('howto')
132 if fn.endswith('.rst') and fn != 'index.rst')
133
134# Additional stuff for the LaTeX preamble.
135latex_preamble = r'''
136\authoraddress{
137 \strong{Python Software Foundation}\\
138 Email: \email{docs@python.org}
139}
140'''
141
142# Documents to append as an appendix to all manuals.
Georg Brandla51f61b2008-02-01 20:45:33 +0000143latex_appendices = ['glossary', 'about', 'license', 'copyright']
Georg Brandl17048282008-02-23 18:47:04 +0000144
145# Options for the coverage checker
146# --------------------------------
147
148# The coverage checker will ignore all modules/functions/classes whose names
149# match any of the following regexes (using re.match).
150coverage_ignore_modules = [
151 r'[T|t][k|K]',
152 r'Tix',
153 r'distutils.*',
154]
155
156coverage_ignore_functions = [
157 'test($|_)',
158]
159
160coverage_ignore_classes = [
161]
162
163# Glob patterns for C source files for C API coverage, relative to this directory.
164coverage_c_path = [
165 '../Include/*.h',
166]
167
168# Regexes to find C items in the source files.
169coverage_c_regexes = {
170 'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'),
171 'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'),
172 'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'),
173}
174
175# The coverage checker will ignore all C items whose names match these regexes
176# (using re.match) -- the keys must be the same as in coverage_c_regexes.
177coverage_ignore_c_items = {
178# 'cfunction': [...]
179}