2008-03-09 16:32:24 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
2009-01-10 13:45:45 -06:00
|
|
|
# Sphinx documentation build configuration file
|
2008-03-09 16:32:24 -05:00
|
|
|
|
2010-01-17 11:16:14 -06:00
|
|
|
import re
|
|
|
|
import sphinx
|
2008-03-09 16:32:24 -05:00
|
|
|
|
2009-04-04 14:05:04 -05:00
|
|
|
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
|
2010-02-28 10:24:55 -06:00
|
|
|
'sphinx.ext.autosummary', 'sphinx.ext.extlinks']
|
2009-05-02 13:38:45 -05:00
|
|
|
|
2008-03-09 16:32:24 -05:00
|
|
|
master_doc = 'contents'
|
2010-01-17 11:16:14 -06:00
|
|
|
templates_path = ['_templates']
|
2010-01-06 08:48:39 -06:00
|
|
|
exclude_patterns = ['_build']
|
|
|
|
|
2008-03-09 16:32:24 -05:00
|
|
|
project = 'Sphinx'
|
2011-01-04 03:00:51 -06:00
|
|
|
copyright = '2007-2011, Georg Brandl'
|
2008-08-30 16:56:43 -05:00
|
|
|
version = sphinx.__released__
|
2008-04-27 15:12:41 -05:00
|
|
|
release = version
|
2008-03-09 16:32:24 -05:00
|
|
|
show_authors = True
|
|
|
|
|
2010-05-25 16:59:22 -05:00
|
|
|
html_theme = 'sphinxdoc'
|
2009-01-10 14:54:26 -06:00
|
|
|
modindex_common_prefix = ['sphinx.']
|
2008-03-21 10:20:50 -05:00
|
|
|
html_static_path = ['_static']
|
2010-01-07 10:56:09 -06:00
|
|
|
html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']}
|
2008-04-19 16:28:24 -05:00
|
|
|
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
|
|
|
|
2008-03-09 16:32:24 -05:00
|
|
|
htmlhelp_basename = 'Sphinxdoc'
|
|
|
|
|
2009-12-29 05:32:42 -06:00
|
|
|
epub_theme = 'epub'
|
2009-12-28 10:09:09 -06:00
|
|
|
epub_basename = 'sphinx'
|
2009-12-29 05:32:42 -06:00
|
|
|
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
|
2010-06-07 15:28:48 -05:00
|
|
|
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']
|
|
|
|
|
2008-03-09 16:32:24 -05:00
|
|
|
latex_documents = [('contents', 'sphinx.tex', 'Sphinx Documentation',
|
2008-05-04 16:35:03 -05:00
|
|
|
'Georg Brandl', 'manual', 1)]
|
2008-04-27 14:43:45 -05:00
|
|
|
latex_logo = '_static/sphinx.png'
|
2008-09-24 11:18:45 -05:00
|
|
|
latex_elements = {
|
2009-06-04 10:50:37 -05:00
|
|
|
'fontpkg': '\\usepackage{palatino}',
|
2008-09-24 11:18:45 -05:00
|
|
|
}
|
2008-03-09 16:32:24 -05:00
|
|
|
|
2010-02-28 07:45:43 -06:00
|
|
|
autodoc_member_order = 'groupwise'
|
2008-11-09 12:46:32 -06:00
|
|
|
todo_include_todos = True
|
2010-05-24 06:06:55 -05:00
|
|
|
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),
|
2010-02-25 15:22:01 -06:00
|
|
|
('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
|
|
|
]
|
|
|
|
|
2010-08-05 06:39:23 -05: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
|
|
|
|
2009-01-10 13:45:45 -06:00
|
|
|
# -- Extension interface -------------------------------------------------------
|
2008-04-06 12:38:55 -05:00
|
|
|
|
|
|
|
from sphinx import addnodes
|
|
|
|
|
|
|
|
|
2008-05-31 11:14:36 -05:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2008-04-06 12:38:55 -05:00
|
|
|
def setup(app):
|
2008-06-22 16:02:50 -05:00
|
|
|
from sphinx.ext.autodoc import cut_lines
|
2011-01-07 09:27:47 -06:00
|
|
|
from sphinx.util.docfields import GroupedField
|
2008-06-22 16:02:50 -05:00
|
|
|
app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))
|
2011-01-07 09:27:47 -06:00
|
|
|
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])
|