blob: 368ef7f6fe7f124fd189d2f58cd930356b3cded8 [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 Brandl56eadd92008-01-27 20:25:12 +000016extensions = ['sphinx.addons.refcounting']
17
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.
41unused_files = [
42 'whatsnew/2.0.rst',
43 'whatsnew/2.1.rst',
44 'whatsnew/2.2.rst',
45 'whatsnew/2.3.rst',
46 'whatsnew/2.4.rst',
47 'whatsnew/2.5.rst',
48 'maclib/scrap.rst',
49 'library/xmllib.rst',
50 'library/xml.etree.rst',
51]
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.
89htmlhelp_basename = 'pydoc'
90
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 = [
105 ('c-api/index.rst', 'c-api.tex',
106 'The Python/C API', _stdauthor, 'manual'),
107 ('distutils/index.rst', 'distutils.tex',
108 'Distributing Python Modules', _stdauthor, 'manual'),
109 ('documenting/index.rst', 'documenting.tex',
110 'Documenting Python', 'Georg Brandl', 'manual'),
111 ('extending/index.rst', 'extending.tex',
112 'Extending and Embedding Python', _stdauthor, 'manual'),
113 ('install/index.rst', 'install.tex',
114 'Installing Python Modules', _stdauthor, 'manual'),
115 ('library/index.rst', 'library.tex',
116 'The Python Library Reference', _stdauthor, 'manual'),
117 ('reference/index.rst', 'reference.tex',
118 'The Python Language Reference', _stdauthor, 'manual'),
119 ('tutorial/index.rst', 'tutorial.tex',
120 'Python Tutorial', _stdauthor, 'manual'),
121 ('using/index.rst', 'using.tex',
122 'Using Python', _stdauthor, 'manual'),
123 ('whatsnew/' + version + '.rst', 'whatsnew.tex',
124 'What\'s New in Python', 'A. M. Kuchling', 'howto'),
125]
126# Collect all HOWTOs individually
Georg Brandl7155a092008-01-16 20:27:56 +0000127latex_documents.extend(('howto/' + fn, 'howto-' + fn[:-4] + '.tex',
128 '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.
141latex_appendices = ['glossary.rst', 'about.rst', 'license.rst', 'copyright.rst']