/Doc/conf.py

http://unladen-swallow.googlecode.com/ · Python · 184 lines · 91 code · 36 blank · 57 comment · 3 complexity · 5fb5a46e69b2ebbe75b2c1119164d83e MD5 · raw file

  1. # -*- coding: utf-8 -*-
  2. #
  3. # Python documentation build configuration file
  4. #
  5. # This file is execfile()d with the current directory set to its containing dir.
  6. #
  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).
  9. import sys, os, time
  10. sys.path.append(os.path.abspath('tools/sphinxext'))
  11. # General configuration
  12. # ---------------------
  13. extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage',
  14. 'sphinx.ext.doctest', 'pyspecific']
  15. templates_path = ['tools/sphinxext']
  16. # General substitutions.
  17. project = 'Python'
  18. copyright = '1990-%s, Python Software Foundation' % time.strftime('%Y')
  19. # The default replacements for |version| and |release|.
  20. #
  21. # The short X.Y version.
  22. # version = '2.6'
  23. # The full version, including alpha/beta/rc tags.
  24. # release = '2.6a0'
  25. # We look for the Include/patchlevel.h file in the current Python source tree
  26. # and replace the values accordingly.
  27. import patchlevel
  28. version, release = patchlevel.get_version_info()
  29. # There are two options for replacing |today|: either, you set today to some
  30. # non-false value, then it is used:
  31. today = ''
  32. # Else, today_fmt is used as the format for a strftime call.
  33. today_fmt = '%B %d, %Y'
  34. # List of files that shouldn't be included in the build.
  35. unused_docs = [
  36. 'maclib/scrap',
  37. 'library/xmllib',
  38. 'library/xml.etree',
  39. ]
  40. # Relative filename of the reference count data file.
  41. refcount_file = 'data/refcounts.dat'
  42. # If true, '()' will be appended to :func: etc. cross-reference text.
  43. add_function_parentheses = True
  44. # If true, the current module name will be prepended to all description
  45. # unit titles (such as .. function::).
  46. add_module_names = True
  47. # Options for HTML output
  48. # -----------------------
  49. # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
  50. # using the given strftime format.
  51. html_last_updated_fmt = '%b %d, %Y'
  52. # If true, SmartyPants will be used to convert quotes and dashes to
  53. # typographically correct entities.
  54. html_use_smartypants = True
  55. # Custom sidebar templates, filenames relative to this file.
  56. html_sidebars = {
  57. 'index': 'indexsidebar.html',
  58. }
  59. # Additional templates that should be rendered to pages.
  60. html_additional_pages = {
  61. 'download': 'download.html',
  62. 'index': 'indexcontent.html',
  63. }
  64. # Output an OpenSearch description file.
  65. html_use_opensearch = 'http://docs.python.org/dev'
  66. # Additional static files.
  67. html_static_path = ['tools/sphinxext/static']
  68. # Output file base name for HTML help builder.
  69. htmlhelp_basename = 'python' + release.replace('.', '')
  70. # Split the index
  71. html_split_index = True
  72. # Options for LaTeX output
  73. # ------------------------
  74. # The paper size ('letter' or 'a4').
  75. latex_paper_size = 'a4'
  76. # The font size ('10pt', '11pt' or '12pt').
  77. latex_font_size = '10pt'
  78. # Grouping the document tree into LaTeX files. List of tuples
  79. # (source start file, target name, title, author, document class [howto/manual]).
  80. _stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor'
  81. latex_documents = [
  82. ('c-api/index', 'c-api.tex',
  83. 'The Python/C API', _stdauthor, 'manual'),
  84. ('distutils/index', 'distutils.tex',
  85. 'Distributing Python Modules', _stdauthor, 'manual'),
  86. ('documenting/index', 'documenting.tex',
  87. 'Documenting Python', 'Georg Brandl', 'manual'),
  88. ('extending/index', 'extending.tex',
  89. 'Extending and Embedding Python', _stdauthor, 'manual'),
  90. ('install/index', 'install.tex',
  91. 'Installing Python Modules', _stdauthor, 'manual'),
  92. ('library/index', 'library.tex',
  93. 'The Python Library Reference', _stdauthor, 'manual'),
  94. ('reference/index', 'reference.tex',
  95. 'The Python Language Reference', _stdauthor, 'manual'),
  96. ('tutorial/index', 'tutorial.tex',
  97. 'Python Tutorial', _stdauthor, 'manual'),
  98. ('using/index', 'using.tex',
  99. 'Using Python', _stdauthor, 'manual'),
  100. ('whatsnew/' + version, 'whatsnew.tex',
  101. 'What\'s New in Python', 'A. M. Kuchling', 'howto'),
  102. ]
  103. # Collect all HOWTOs individually
  104. latex_documents.extend(('howto/' + fn[:-4], 'howto-' + fn[:-4] + '.tex',
  105. '', _stdauthor, 'howto')
  106. for fn in os.listdir('howto')
  107. if fn.endswith('.rst') and fn != 'index.rst')
  108. # Additional stuff for the LaTeX preamble.
  109. latex_preamble = r'''
  110. \authoraddress{
  111. \strong{Python Software Foundation}\\
  112. Email: \email{docs@python.org}
  113. }
  114. \let\Verbatim=\OriginalVerbatim
  115. \let\endVerbatim=\endOriginalVerbatim
  116. '''
  117. # Documents to append as an appendix to all manuals.
  118. latex_appendices = ['glossary', 'about', 'license', 'copyright']
  119. latex_elements = {'inputenc': '\\usepackage[utf8x]{inputenc}'}
  120. # Options for the coverage checker
  121. # --------------------------------
  122. # The coverage checker will ignore all modules/functions/classes whose names
  123. # match any of the following regexes (using re.match).
  124. coverage_ignore_modules = [
  125. r'[T|t][k|K]',
  126. r'Tix',
  127. r'distutils.*',
  128. ]
  129. coverage_ignore_functions = [
  130. 'test($|_)',
  131. ]
  132. coverage_ignore_classes = [
  133. ]
  134. # Glob patterns for C source files for C API coverage, relative to this directory.
  135. coverage_c_path = [
  136. '../Include/*.h',
  137. ]
  138. # Regexes to find C items in the source files.
  139. coverage_c_regexes = {
  140. 'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'),
  141. 'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'),
  142. 'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'),
  143. }
  144. # The coverage checker will ignore all C items whose names match these regexes
  145. # (using re.match) -- the keys must be the same as in coverage_c_regexes.
  146. coverage_ignore_c_items = {
  147. # 'cfunction': [...]
  148. }