2007-08-15 11:28:01 -03:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
# Python documentation build configuration file
|
|
|
|
#
|
2008-01-16 16:27:56 -04:00
|
|
|
# This file is execfile()d with the current directory set to its containing dir.
|
|
|
|
#
|
2007-08-15 11:28:01 -03:00
|
|
|
# The contents of this file are pickled, so don't put values in the namespace
|
|
|
|
# that aren't pickleable (module imports are okay, they're removed automatically).
|
2007-12-16 15:36:51 -04:00
|
|
|
|
2008-01-21 16:20:53 -04:00
|
|
|
import sys, os, time
|
2008-04-12 15:11:18 -03:00
|
|
|
sys.path.append(os.path.abspath('tools/sphinxext'))
|
2008-01-21 16:20:53 -04:00
|
|
|
|
2007-12-16 15:36:51 -04:00
|
|
|
# General configuration
|
|
|
|
# ---------------------
|
2007-08-15 11:28:01 -03:00
|
|
|
|
2008-03-22 07:56:23 -03:00
|
|
|
extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage',
|
2008-04-09 14:58:56 -03:00
|
|
|
'sphinx.ext.doctest', 'pyspecific']
|
2008-03-09 15:18:30 -03:00
|
|
|
templates_path = ['tools/sphinxext']
|
2008-01-27 16:25:12 -04:00
|
|
|
|
2008-01-16 16:27:56 -04:00
|
|
|
# General substitutions.
|
|
|
|
project = 'Python'
|
2008-01-21 16:20:53 -04:00
|
|
|
copyright = '1990-%s, Python Software Foundation' % time.strftime('%Y')
|
2008-01-16 16:27:56 -04:00
|
|
|
|
2007-08-15 11:28:01 -03:00
|
|
|
# The default replacements for |version| and |release|.
|
|
|
|
#
|
|
|
|
# The short X.Y version.
|
|
|
|
# version = '2.6'
|
|
|
|
# The full version, including alpha/beta/rc tags.
|
|
|
|
# release = '2.6a0'
|
2008-01-21 16:20:53 -04:00
|
|
|
|
|
|
|
# We look for the Include/patchlevel.h file in the current Python source tree
|
|
|
|
# and replace the values accordingly.
|
|
|
|
import patchlevel
|
|
|
|
version, release = patchlevel.get_version_info()
|
2007-08-15 11:28:01 -03:00
|
|
|
|
|
|
|
# There are two options for replacing |today|: either, you set today to some
|
|
|
|
# non-false value, then it is used:
|
|
|
|
today = ''
|
|
|
|
# Else, today_fmt is used as the format for a strftime call.
|
|
|
|
today_fmt = '%B %d, %Y'
|
|
|
|
|
|
|
|
# List of files that shouldn't be included in the build.
|
2008-02-09 19:09:25 -04:00
|
|
|
unused_docs = [
|
|
|
|
'maclib/scrap',
|
|
|
|
'library/xmllib',
|
|
|
|
'library/xml.etree',
|
2007-08-15 11:28:01 -03:00
|
|
|
]
|
|
|
|
|
2009-05-17 11:16:29 -03:00
|
|
|
# Ignore .rst in Sphinx its self.
|
2009-05-17 13:59:27 -03:00
|
|
|
exclude_trees = ['tools/sphinx']
|
2009-05-17 11:16:29 -03:00
|
|
|
|
2008-01-16 16:27:56 -04:00
|
|
|
# Relative filename of the reference count data file.
|
|
|
|
refcount_file = 'data/refcounts.dat'
|
|
|
|
|
2007-12-16 15:36:51 -04:00
|
|
|
# If true, '()' will be appended to :func: etc. cross-reference text.
|
|
|
|
add_function_parentheses = True
|
|
|
|
|
|
|
|
# If true, the current module name will be prepended to all description
|
|
|
|
# unit titles (such as .. function::).
|
|
|
|
add_module_names = True
|
|
|
|
|
|
|
|
|
|
|
|
# Options for HTML output
|
|
|
|
# -----------------------
|
|
|
|
|
2007-08-15 11:28:01 -03:00
|
|
|
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
|
|
|
# using the given strftime format.
|
2007-12-16 15:36:51 -04:00
|
|
|
html_last_updated_fmt = '%b %d, %Y'
|
2007-08-15 11:28:01 -03:00
|
|
|
|
|
|
|
# If true, SmartyPants will be used to convert quotes and dashes to
|
|
|
|
# typographically correct entities.
|
2007-12-16 15:36:51 -04:00
|
|
|
html_use_smartypants = True
|
2007-08-15 11:28:01 -03:00
|
|
|
|
2008-01-16 16:27:56 -04:00
|
|
|
# Custom sidebar templates, filenames relative to this file.
|
|
|
|
html_sidebars = {
|
2008-03-09 15:18:30 -03:00
|
|
|
'index': 'indexsidebar.html',
|
2008-01-16 16:27:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Additional templates that should be rendered to pages.
|
|
|
|
html_additional_pages = {
|
2008-03-09 15:18:30 -03:00
|
|
|
'download': 'download.html',
|
2008-04-19 18:28:38 -03:00
|
|
|
'index': 'indexcontent.html',
|
2008-01-16 16:27:56 -04:00
|
|
|
}
|
|
|
|
|
2008-04-27 17:03:05 -03:00
|
|
|
# Output an OpenSearch description file.
|
2008-05-03 17:16:47 -03:00
|
|
|
html_use_opensearch = 'http://docs.python.org/dev'
|
2008-04-27 17:03:05 -03:00
|
|
|
|
|
|
|
# Additional static files.
|
|
|
|
html_static_path = ['tools/sphinxext/static']
|
|
|
|
|
2008-01-16 16:27:56 -04:00
|
|
|
# Output file base name for HTML help builder.
|
2008-03-02 02:45:40 -04:00
|
|
|
htmlhelp_basename = 'python' + release.replace('.', '')
|
2008-01-16 16:27:56 -04:00
|
|
|
|
2008-06-17 06:01:35 -03:00
|
|
|
# Split the index
|
|
|
|
html_split_index = True
|
|
|
|
|
2007-08-15 11:28:01 -03:00
|
|
|
|
2007-12-16 15:36:51 -04:00
|
|
|
# Options for LaTeX output
|
|
|
|
# ------------------------
|
|
|
|
|
2008-01-16 16:27:56 -04:00
|
|
|
# The paper size ('letter' or 'a4').
|
|
|
|
latex_paper_size = 'a4'
|
|
|
|
|
|
|
|
# The font size ('10pt', '11pt' or '12pt').
|
|
|
|
latex_font_size = '10pt'
|
|
|
|
|
|
|
|
# Grouping the document tree into LaTeX files. List of tuples
|
|
|
|
# (source start file, target name, title, author, document class [howto/manual]).
|
|
|
|
_stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor'
|
|
|
|
latex_documents = [
|
2008-02-01 16:45:33 -04:00
|
|
|
('c-api/index', 'c-api.tex',
|
2008-01-16 16:27:56 -04:00
|
|
|
'The Python/C API', _stdauthor, 'manual'),
|
2008-02-01 16:45:33 -04:00
|
|
|
('distutils/index', 'distutils.tex',
|
2008-01-16 16:27:56 -04:00
|
|
|
'Distributing Python Modules', _stdauthor, 'manual'),
|
2008-02-01 16:45:33 -04:00
|
|
|
('documenting/index', 'documenting.tex',
|
2008-01-16 16:27:56 -04:00
|
|
|
'Documenting Python', 'Georg Brandl', 'manual'),
|
2008-02-01 16:45:33 -04:00
|
|
|
('extending/index', 'extending.tex',
|
2008-01-16 16:27:56 -04:00
|
|
|
'Extending and Embedding Python', _stdauthor, 'manual'),
|
2008-02-01 16:45:33 -04:00
|
|
|
('install/index', 'install.tex',
|
2008-01-16 16:27:56 -04:00
|
|
|
'Installing Python Modules', _stdauthor, 'manual'),
|
2008-02-01 16:45:33 -04:00
|
|
|
('library/index', 'library.tex',
|
2008-01-16 16:27:56 -04:00
|
|
|
'The Python Library Reference', _stdauthor, 'manual'),
|
2008-02-01 16:45:33 -04:00
|
|
|
('reference/index', 'reference.tex',
|
2008-01-16 16:27:56 -04:00
|
|
|
'The Python Language Reference', _stdauthor, 'manual'),
|
2008-02-01 16:45:33 -04:00
|
|
|
('tutorial/index', 'tutorial.tex',
|
2008-01-16 16:27:56 -04:00
|
|
|
'Python Tutorial', _stdauthor, 'manual'),
|
2008-02-01 16:45:33 -04:00
|
|
|
('using/index', 'using.tex',
|
2008-01-16 16:27:56 -04:00
|
|
|
'Using Python', _stdauthor, 'manual'),
|
2008-02-01 16:45:33 -04:00
|
|
|
('whatsnew/' + version, 'whatsnew.tex',
|
2008-01-16 16:27:56 -04:00
|
|
|
'What\'s New in Python', 'A. M. Kuchling', 'howto'),
|
|
|
|
]
|
|
|
|
# Collect all HOWTOs individually
|
2008-02-01 16:45:33 -04:00
|
|
|
latex_documents.extend(('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex',
|
2008-11-08 07:47:44 -04:00
|
|
|
'', _stdauthor, 'howto')
|
2008-01-16 16:27:56 -04:00
|
|
|
for fn in os.listdir('howto')
|
|
|
|
if fn.endswith('.rst') and fn != 'index.rst')
|
|
|
|
|
|
|
|
# Additional stuff for the LaTeX preamble.
|
|
|
|
latex_preamble = r'''
|
|
|
|
\authoraddress{
|
|
|
|
\strong{Python Software Foundation}\\
|
|
|
|
Email: \email{docs@python.org}
|
|
|
|
}
|
2008-11-19 03:59:09 -04:00
|
|
|
\let\Verbatim=\OriginalVerbatim
|
|
|
|
\let\endVerbatim=\endOriginalVerbatim
|
2008-01-16 16:27:56 -04:00
|
|
|
'''
|
2007-12-16 15:36:51 -04:00
|
|
|
|
2008-01-16 16:27:56 -04:00
|
|
|
# Documents to append as an appendix to all manuals.
|
2008-02-01 16:45:33 -04:00
|
|
|
latex_appendices = ['glossary', 'about', 'license', 'copyright']
|
2008-02-23 14:47:04 -04:00
|
|
|
|
2009-08-24 14:42:36 -03:00
|
|
|
# Get LaTeX to handle Unicode correctly
|
|
|
|
latex_elements = {'inputenc': r'\usepackage[utf8x]{inputenc}'}
|
|
|
|
|
2008-02-23 14:47:04 -04:00
|
|
|
# Options for the coverage checker
|
|
|
|
# --------------------------------
|
|
|
|
|
|
|
|
# The coverage checker will ignore all modules/functions/classes whose names
|
|
|
|
# match any of the following regexes (using re.match).
|
|
|
|
coverage_ignore_modules = [
|
|
|
|
r'[T|t][k|K]',
|
|
|
|
r'Tix',
|
|
|
|
r'distutils.*',
|
|
|
|
]
|
|
|
|
|
|
|
|
coverage_ignore_functions = [
|
|
|
|
'test($|_)',
|
|
|
|
]
|
|
|
|
|
|
|
|
coverage_ignore_classes = [
|
|
|
|
]
|
|
|
|
|
|
|
|
# Glob patterns for C source files for C API coverage, relative to this directory.
|
|
|
|
coverage_c_path = [
|
|
|
|
'../Include/*.h',
|
|
|
|
]
|
|
|
|
|
|
|
|
# Regexes to find C items in the source files.
|
|
|
|
coverage_c_regexes = {
|
|
|
|
'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'),
|
|
|
|
'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'),
|
|
|
|
'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'),
|
|
|
|
}
|
|
|
|
|
|
|
|
# The coverage checker will ignore all C items whose names match these regexes
|
|
|
|
# (using re.match) -- the keys must be the same as in coverage_c_regexes.
|
|
|
|
coverage_ignore_c_items = {
|
|
|
|
# 'cfunction': [...]
|
|
|
|
}
|