cpython/Doc/conf.py

191 lines
5.7 KiB
Python
Raw Normal View History

2007-08-15 11:28:01 -03:00
# -*- coding: utf-8 -*-
#
# Python documentation build configuration file
#
# 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
extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage',
'sphinx.ext.doctest', 'pyspecific']
2008-03-09 15:18:30 -03:00
templates_path = ['tools/sphinxext']
# General substitutions.
project = 'Python'
2008-01-21 16:20:53 -04:00
copyright = '1990-%s, Python Software Foundation' % time.strftime('%Y')
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
# 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
# Custom sidebar templates, filenames relative to this file.
html_sidebars = {
2008-03-09 15:18:30 -03:00
'index': 'indexsidebar.html',
}
# 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',
}
# Output an OpenSearch description file.
2008-05-03 17:16:47 -03:00
html_use_opensearch = 'http://docs.python.org/dev'
# Additional static files.
html_static_path = ['tools/sphinxext/static']
# Output file base name for HTML help builder.
htmlhelp_basename = 'python' + release.replace('.', '')
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
# ------------------------
# 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',
'The Python/C API', _stdauthor, 'manual'),
2008-02-01 16:45:33 -04:00
('distutils/index', 'distutils.tex',
'Distributing Python Modules', _stdauthor, 'manual'),
2008-02-01 16:45:33 -04:00
('documenting/index', 'documenting.tex',
'Documenting Python', 'Georg Brandl', 'manual'),
2008-02-01 16:45:33 -04:00
('extending/index', 'extending.tex',
'Extending and Embedding Python', _stdauthor, 'manual'),
2008-02-01 16:45:33 -04:00
('install/index', 'install.tex',
'Installing Python Modules', _stdauthor, 'manual'),
2008-02-01 16:45:33 -04:00
('library/index', 'library.tex',
'The Python Library Reference', _stdauthor, 'manual'),
2008-02-01 16:45:33 -04:00
('reference/index', 'reference.tex',
'The Python Language Reference', _stdauthor, 'manual'),
2008-02-01 16:45:33 -04:00
('tutorial/index', 'tutorial.tex',
'Python Tutorial', _stdauthor, 'manual'),
2008-02-01 16:45:33 -04:00
('using/index', 'using.tex',
Merged revisions 82798,82805,83659,83977,84015,84018,84141,84264,84326-84327,84480,84482,84484,84530-84531,84553,84619,84915-84916 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82798 | georg.brandl | 2010-07-11 11:23:11 +0200 (So, 11 Jul 2010) | 1 line #6774: explain shutdown() behavior varying with platform. ........ r82805 | georg.brandl | 2010-07-11 11:42:10 +0200 (So, 11 Jul 2010) | 1 line #7935: cross-reference to ast.literal_eval() from eval() docs. ........ r83659 | georg.brandl | 2010-08-03 14:06:29 +0200 (Di, 03 Aug 2010) | 1 line Terminology fix: exceptions are raised, except in generator.throw(). ........ r83977 | georg.brandl | 2010-08-13 17:10:49 +0200 (Fr, 13 Aug 2010) | 1 line Fix copy-paste error. ........ r84015 | georg.brandl | 2010-08-14 17:44:34 +0200 (Sa, 14 Aug 2010) | 1 line Add some maintainers. ........ r84018 | georg.brandl | 2010-08-14 17:48:49 +0200 (Sa, 14 Aug 2010) | 1 line Typo fix. ........ r84141 | georg.brandl | 2010-08-17 16:11:59 +0200 (Di, 17 Aug 2010) | 1 line Markup nits. ........ r84264 | georg.brandl | 2010-08-22 22:23:38 +0200 (So, 22 Aug 2010) | 1 line #9649: fix default value description. ........ r84326 | georg.brandl | 2010-08-26 16:30:15 +0200 (Do, 26 Aug 2010) | 1 line #9689: add links from overview to in-depth class API descriptions. ........ r84327 | georg.brandl | 2010-08-26 16:30:56 +0200 (Do, 26 Aug 2010) | 1 line #9681: typo. ........ r84480 | georg.brandl | 2010-09-04 00:33:27 +0200 (Sa, 04 Sep 2010) | 1 line More inclusive title. ........ r84482 | georg.brandl | 2010-09-04 00:40:02 +0200 (Sa, 04 Sep 2010) | 1 line #9760: clarify what context expression is. ........ r84484 | georg.brandl | 2010-09-04 00:49:27 +0200 (Sa, 04 Sep 2010) | 1 line Fix missing word. ........ r84530 | georg.brandl | 2010-09-05 19:07:12 +0200 (So, 05 Sep 2010) | 1 line #9747: fix copy-paste error in getresgid() doc. ........ r84531 | georg.brandl | 2010-09-05 19:09:18 +0200 (So, 05 Sep 2010) | 1 line #9776: fix some spacing. ........ r84553 | georg.brandl | 2010-09-06 08:49:07 +0200 (Mo, 06 Sep 2010) | 1 line #9780: both { and } are not valid fill characters. ........ r84619 | georg.brandl | 2010-09-08 12:43:45 +0200 (Mi, 08 Sep 2010) | 1 line Add Lukasz. ........ r84915 | georg.brandl | 2010-09-20 08:27:02 +0200 (Mo, 20 Sep 2010) | 1 line Fix typo. ........ r84916 | georg.brandl | 2010-09-20 08:29:01 +0200 (Mo, 20 Sep 2010) | 1 line Mention % as string formatting. ........
2010-10-06 06:28:45 -03:00
'Python Setup and Usage', _stdauthor, 'manual'),
Merged revisions 85843,85849-85850,85867,85907,85914,86134,86187,86315-86316,86390,86424-86425,86428 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85843 | georg.brandl | 2010-10-26 08:59:23 +0200 (Di, 26 Okt 2010) | 1 line Markup fix. ........ r85849 | georg.brandl | 2010-10-26 21:31:06 +0200 (Di, 26 Okt 2010) | 1 line #10200: typo. ........ r85850 | georg.brandl | 2010-10-26 21:58:11 +0200 (Di, 26 Okt 2010) | 1 line #10200: typo. ........ r85867 | georg.brandl | 2010-10-27 22:01:51 +0200 (Mi, 27 Okt 2010) | 1 line Add David. ........ r85907 | georg.brandl | 2010-10-29 06:54:13 +0200 (Fr, 29 Okt 2010) | 1 line #10222: fix for overzealous AIX compiler. ........ r85914 | georg.brandl | 2010-10-29 08:17:38 +0200 (Fr, 29 Okt 2010) | 1 line (?:...) is a non-capturing, but still grouping construct. ........ r86134 | georg.brandl | 2010-11-03 08:41:00 +0100 (Mi, 03 Nov 2010) | 1 line A newline in lineno output breaks pyframe output. ........ r86187 | georg.brandl | 2010-11-05 08:10:41 +0100 (Fr, 05 Nov 2010) | 1 line Move glossary entry to the right position and fix link. ........ r86315 | georg.brandl | 2010-11-08 12:05:18 +0100 (Mo, 08 Nov 2010) | 1 line Fix latex conversion glitch in property/feature descriptions. ........ r86316 | georg.brandl | 2010-11-08 12:08:35 +0100 (Mo, 08 Nov 2010) | 1 line Fix typo. ........ r86390 | georg.brandl | 2010-11-10 08:57:10 +0100 (Mi, 10 Nov 2010) | 1 line Fix typo. ........ r86424 | georg.brandl | 2010-11-12 07:19:48 +0100 (Fr, 12 Nov 2010) | 1 line Build a PDF of the FAQs too. ........ r86425 | georg.brandl | 2010-11-12 07:20:12 +0100 (Fr, 12 Nov 2010) | 1 line #10008: Fix duplicate index entry. ........ r86428 | georg.brandl | 2010-11-12 09:09:26 +0100 (Fr, 12 Nov 2010) | 1 line Fix weird line block in table. ........
2010-11-26 04:20:18 -04:00
('faq/index', 'faq.tex',
'Python Frequently Asked Questions', _stdauthor, 'manual'),
2008-02-01 16:45:33 -04:00
('whatsnew/' + version, 'whatsnew.tex',
'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',
'', _stdauthor, 'howto')
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
'''
2007-12-16 15:36:51 -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']
# Get LaTeX to handle Unicode correctly
latex_elements = {'inputenc': r'\usepackage[utf8x]{inputenc}'}
# 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': [...]
}