Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | # |
| 3 | # Python documentation build configuration file |
| 4 | # |
Georg Brandl | 7155a09 | 2008-01-16 20:27:56 +0000 | [diff] [blame] | 5 | # This file is execfile()d with the current directory set to its containing dir. |
| 6 | # |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 7 | # 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 Brandl | eee1fc5 | 2007-12-16 19:36:51 +0000 | [diff] [blame] | 9 | |
Georg Brandl | dd76e05 | 2008-01-21 20:20:53 +0000 | [diff] [blame] | 10 | import sys, os, time |
| 11 | sys.path.append('tools/sphinxext') |
| 12 | |
Georg Brandl | eee1fc5 | 2007-12-16 19:36:51 +0000 | [diff] [blame] | 13 | # General configuration |
| 14 | # --------------------- |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 15 | |
Georg Brandl | 56eadd9 | 2008-01-27 20:25:12 +0000 | [diff] [blame] | 16 | extensions = ['sphinx.addons.refcounting'] |
| 17 | |
Georg Brandl | 7155a09 | 2008-01-16 20:27:56 +0000 | [diff] [blame] | 18 | # General substitutions. |
| 19 | project = 'Python' |
Georg Brandl | dd76e05 | 2008-01-21 20:20:53 +0000 | [diff] [blame] | 20 | copyright = '1990-%s, Python Software Foundation' % time.strftime('%Y') |
Georg Brandl | 7155a09 | 2008-01-16 20:27:56 +0000 | [diff] [blame] | 21 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 22 | # The default replacements for |version| and |release|. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 23 | # |
| 24 | # The short X.Y version. |
| 25 | # version = '2.6' |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 26 | # The full version, including alpha/beta/rc tags. |
| 27 | # release = '2.6a0' |
Georg Brandl | dd76e05 | 2008-01-21 20:20:53 +0000 | [diff] [blame] | 28 | |
| 29 | # We look for the Include/patchlevel.h file in the current Python source tree |
| 30 | # and replace the values accordingly. |
| 31 | import patchlevel |
| 32 | version, release = patchlevel.get_version_info() |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 33 | |
| 34 | # There are two options for replacing |today|: either, you set today to some |
| 35 | # non-false value, then it is used: |
| 36 | today = '' |
| 37 | # Else, today_fmt is used as the format for a strftime call. |
| 38 | today_fmt = '%B %d, %Y' |
| 39 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 40 | # List of files that shouldn't be included in the build. |
| 41 | unused_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 Brandl | 7155a09 | 2008-01-16 20:27:56 +0000 | [diff] [blame] | 53 | # Relative filename of the reference count data file. |
| 54 | refcount_file = 'data/refcounts.dat' |
| 55 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 56 | # If true, '()' will be appended to :func: etc. cross-reference text. |
| 57 | add_function_parentheses = True |
| 58 | |
| 59 | # If true, the current module name will be prepended to all description |
| 60 | # unit titles (such as .. function::). |
| 61 | add_module_names = True |
Georg Brandl | eee1fc5 | 2007-12-16 19:36:51 +0000 | [diff] [blame] | 62 | |
| 63 | |
| 64 | # Options for HTML output |
| 65 | # ----------------------- |
| 66 | |
Georg Brandl | eee1fc5 | 2007-12-16 19:36:51 +0000 | [diff] [blame] | 67 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
| 68 | # using the given strftime format. |
| 69 | html_last_updated_fmt = '%b %d, %Y' |
| 70 | |
| 71 | # If true, SmartyPants will be used to convert quotes and dashes to |
| 72 | # typographically correct entities. |
| 73 | html_use_smartypants = True |
| 74 | |
Georg Brandl | 7155a09 | 2008-01-16 20:27:56 +0000 | [diff] [blame] | 75 | # Content template for the index page, filename relative to this file. |
| 76 | html_index = 'tools/sphinxext/indexcontent.html' |
| 77 | |
| 78 | # Custom sidebar templates, filenames relative to this file. |
| 79 | html_sidebars = { |
| 80 | 'index': 'tools/sphinxext/indexsidebar.html', |
| 81 | } |
| 82 | |
| 83 | # Additional templates that should be rendered to pages. |
| 84 | html_additional_pages = { |
| 85 | 'download': 'tools/sphinxext/download.html', |
| 86 | } |
| 87 | |
| 88 | # Output file base name for HTML help builder. |
| 89 | htmlhelp_basename = 'pydoc' |
| 90 | |
Georg Brandl | eee1fc5 | 2007-12-16 19:36:51 +0000 | [diff] [blame] | 91 | |
| 92 | # Options for LaTeX output |
| 93 | # ------------------------ |
| 94 | |
Georg Brandl | 7155a09 | 2008-01-16 20:27:56 +0000 | [diff] [blame] | 95 | # The paper size ('letter' or 'a4'). |
| 96 | latex_paper_size = 'a4' |
Georg Brandl | eee1fc5 | 2007-12-16 19:36:51 +0000 | [diff] [blame] | 97 | |
Georg Brandl | 7155a09 | 2008-01-16 20:27:56 +0000 | [diff] [blame] | 98 | # The font size ('10pt', '11pt' or '12pt'). |
| 99 | latex_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' |
| 104 | latex_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 Brandl | 7155a09 | 2008-01-16 20:27:56 +0000 | [diff] [blame] | 127 | latex_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. |
| 133 | latex_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. |
| 141 | latex_appendices = ['glossary.rst', 'about.rst', 'license.rst', 'copyright.rst'] |