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