sphinx/doc/conf.py

104 lines
3.4 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
#
# Sphinx documentation build configuration file
2010-01-17 11:16:14 -06:00
import re
import sphinx
2009-04-04 14:05:04 -05:00
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
'sphinx.ext.autosummary', 'sphinx.ext.extlinks']
2009-05-02 13:38:45 -05:00
master_doc = 'contents'
2010-01-17 11:16:14 -06:00
templates_path = ['_templates']
exclude_patterns = ['_build']
project = 'Sphinx'
2011-01-04 03:00:51 -06:00
copyright = '2007-2011, Georg Brandl'
version = sphinx.__released__
release = version
show_authors = True
2010-05-25 16:59:22 -05:00
html_theme = 'sphinxdoc'
modindex_common_prefix = ['sphinx.']
2008-03-21 10:20:50 -05:00
html_static_path = ['_static']
html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']}
html_additional_pages = {'index': 'index.html'}
2008-05-03 15:18:53 -05:00
html_use_opensearch = 'http://sphinx.pocoo.org'
2008-04-27 13:09:49 -05:00
htmlhelp_basename = 'Sphinxdoc'
epub_theme = 'epub'
2009-12-28 10:09:09 -06:00
epub_basename = 'sphinx'
epub_author = 'Georg Brandl'
2009-12-28 10:09:09 -06:00
epub_publisher = 'http://sphinx.pocoo.org/'
epub_scheme = 'url'
epub_identifier = epub_publisher
epub_pre_files = [('index.html', 'Welcome')]
2009-12-28 10:09:09 -06:00
epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js',
2010-06-03 08:39:24 -05:00
'_static/jquery.js', '_static/searchtools.js', '_static/underscore.js',
2009-12-28 10:09:09 -06:00
'_static/basic.css', 'search.html']
latex_documents = [('contents', 'sphinx.tex', 'Sphinx Documentation',
'Georg Brandl', 'manual', 1)]
latex_logo = '_static/sphinx.png'
2008-09-24 11:18:45 -05:00
latex_elements = {
'fontpkg': '\\usepackage{palatino}',
2008-09-24 11:18:45 -05:00
}
autodoc_member_order = 'groupwise'
2008-11-09 12:46:32 -06:00
todo_include_todos = True
extlinks = {'duref': ('http://docutils.sourceforge.net/docs/ref/rst/'
'restructuredtext.html#%s', ''),
'durole': ('http://docutils.sourceforge.net/docs/ref/rst/'
'roles.html#%s', ''),
'dudir': ('http://docutils.sourceforge.net/docs/ref/rst/'
'directives.html#%s', '')}
2008-11-09 12:46:32 -06:00
2010-02-21 04:50:08 -06:00
man_pages = [
('contents', 'sphinx-all', 'Sphinx documentation generator system manual',
'Georg Brandl', 1),
('man/sphinx-build', 'sphinx-build', 'Sphinx documentation generator tool',
'', 1),
('man/sphinx-quickstart', 'sphinx-quickstart', 'Sphinx documentation '
'template generator', '', 1),
2010-02-21 04:50:08 -06:00
]
# We're not using intersphinx right now, but if we did, this would be part of
# the mapping:
intersphinx_mapping = {'python': ('http://docs.python.org/dev', None)}
2008-11-09 12:46:32 -06:00
# -- Extension interface -------------------------------------------------------
from sphinx import addnodes
event_sig_re = re.compile(r'([a-zA-Z-]+)\s*\((.*)\)')
def parse_event(env, sig, signode):
m = event_sig_re.match(sig)
if not m:
signode += addnodes.desc_name(sig, sig)
return sig
name, args = m.groups()
signode += addnodes.desc_name(name, name)
plist = addnodes.desc_parameterlist()
for arg in args.split(','):
arg = arg.strip()
plist += addnodes.desc_parameter(arg, arg)
signode += plist
return name
def setup(app):
from sphinx.ext.autodoc import cut_lines
from sphinx.util.docfields import GroupedField
app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))
app.add_object_type('confval', 'confval',
objname='configuration value',
indextemplate='pair: %s; configuration value')
fdesc = GroupedField('parameter', label='Parameters',
names=['param'], can_collapse=True)
app.add_object_type('event', 'event', 'pair: %s; event', parse_event,
doc_field_types=[fdesc])