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
|
2018-01-27 10:52:16 -06:00
|
|
|
|
2010-01-17 11:16:14 -06:00
|
|
|
import sphinx
|
2017-03-23 05:03:38 -05:00
|
|
|
|
2014-01-18 12:56:23 -06:00
|
|
|
|
2009-04-04 14:05:04 -05:00
|
|
|
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
|
2014-10-27 23:45:27 -05:00
|
|
|
'sphinx.ext.autosummary', 'sphinx.ext.extlinks',
|
2020-03-09 05:41:14 -05:00
|
|
|
'sphinx.ext.intersphinx',
|
2019-03-10 17:37:05 -05:00
|
|
|
'sphinx.ext.viewcode', 'sphinx.ext.inheritance_diagram']
|
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'
|
2020-02-13 16:57:50 -06:00
|
|
|
copyright = '2007-2020, Georg Brandl and the Sphinx team'
|
2017-04-27 11:19:01 -05:00
|
|
|
version = sphinx.__display_version__
|
2008-04-27 15:12:41 -05:00
|
|
|
release = version
|
2008-03-09 16:32:24 -05:00
|
|
|
show_authors = True
|
|
|
|
|
2013-01-18 16:17:11 -06:00
|
|
|
html_theme = 'sphinx13'
|
|
|
|
html_theme_path = ['_themes']
|
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'}
|
2020-04-18 05:02:17 -05:00
|
|
|
html_use_opensearch = 'https://www.sphinx-doc.org/en/master'
|
2020-04-17 10:01:48 -05:00
|
|
|
html_baseurl = 'https://www.sphinx-doc.org/en/master/'
|
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'
|
2012-11-04 04:28:12 -06:00
|
|
|
epub_publisher = 'http://sphinx-doc.org/'
|
2017-06-29 11:21:16 -05:00
|
|
|
epub_uid = 'web-site'
|
2009-12-28 10:09:09 -06:00
|
|
|
epub_scheme = 'url'
|
|
|
|
epub_identifier = epub_publisher
|
2016-07-20 20:08:27 -05:00
|
|
|
epub_pre_files = [('index.xhtml', 'Welcome')]
|
2018-04-11 10:48:59 -05:00
|
|
|
epub_post_files = [('usage/installation.xhtml', 'Installing Sphinx'),
|
2016-07-20 20:08:27 -05:00
|
|
|
('develop.xhtml', 'Sphinx development')]
|
2009-12-28 10:09:09 -06:00
|
|
|
epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js',
|
2015-03-08 11:15:54 -05:00
|
|
|
'_static/jquery.js', '_static/searchtools.js',
|
|
|
|
'_static/underscore.js', '_static/basic.css',
|
2018-11-04 03:13:07 -06:00
|
|
|
'_static/language_data.js',
|
2015-03-08 11:15:54 -05:00
|
|
|
'search.html', '_static/websupport.js']
|
2011-02-27 15:02:30 -06:00
|
|
|
epub_fix_images = False
|
2011-02-28 14:17:52 -06:00
|
|
|
epub_max_image_width = 0
|
2013-02-09 08:00:47 -06:00
|
|
|
epub_show_urls = 'inline'
|
2013-03-06 11:43:21 -06:00
|
|
|
epub_use_index = False
|
2019-03-17 14:49:36 -05:00
|
|
|
epub_guide = (('toc', 'contents.xhtml', 'Table of Contents'),)
|
2016-09-30 10:17:19 -05:00
|
|
|
epub_description = 'Sphinx documentation generator system manual'
|
2009-12-28 10:09:09 -06:00
|
|
|
|
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 = {
|
2018-11-21 11:58:58 -06:00
|
|
|
'fontenc': r'\usepackage[LGR,X2,T1]{fontenc}',
|
2018-03-30 03:32:08 -05:00
|
|
|
'fontpkg': r'''
|
|
|
|
\usepackage[sc]{mathpazo}
|
|
|
|
\usepackage[scaled]{helvet}
|
|
|
|
\usepackage{courier}
|
2018-11-21 11:58:58 -06:00
|
|
|
\substitutefont{LGR}{\rmdefault}{cmr}
|
|
|
|
\substitutefont{LGR}{\sfdefault}{cmss}
|
2018-11-15 11:04:11 -06:00
|
|
|
\substitutefont{LGR}{\ttdefault}{cmtt}
|
2018-11-21 11:58:58 -06:00
|
|
|
\substitutefont{X2}{\rmdefault}{cmr}
|
|
|
|
\substitutefont{X2}{\sfdefault}{cmss}
|
|
|
|
\substitutefont{X2}{\ttdefault}{cmtt}
|
2018-03-30 03:32:08 -05:00
|
|
|
''',
|
2016-10-29 09:30:33 -05:00
|
|
|
'passoptionstopackages': '\\PassOptionsToPackage{svgnames}{xcolor}',
|
2018-03-29 17:11:17 -05:00
|
|
|
'preamble': '\\DeclareUnicodeCharacter{229E}{\\ensuremath{\\boxplus}}',
|
2018-03-30 15:50:55 -05:00
|
|
|
'fvset': '\\fvset{fontsize=auto}',
|
2018-07-31 03:46:48 -05:00
|
|
|
# fix missing index entry due to RTD doing only once pdflatex after makeindex
|
|
|
|
'printindex': r'''
|
|
|
|
\IfFileExists{\jobname.ind}
|
|
|
|
{\footnotesize\raggedright\printindex}
|
|
|
|
{\begin{sphinxtheindex}\end{sphinxtheindex}}
|
|
|
|
''',
|
2008-09-24 11:18:45 -05:00
|
|
|
}
|
2011-01-06 11:29:37 -06:00
|
|
|
latex_show_urls = 'footnote'
|
2018-07-13 07:37:39 -05:00
|
|
|
latex_use_xindy = True
|
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),
|
2011-10-07 05:27:19 -05:00
|
|
|
('man/sphinx-apidoc', 'sphinx-apidoc', 'Sphinx API doc generator tool',
|
|
|
|
'', 1),
|
2017-07-11 09:58:20 -05:00
|
|
|
('man/sphinx-autogen', 'sphinx-autogen', 'Generate autodoc stub pages',
|
|
|
|
'', 1),
|
2010-02-21 04:50:08 -06:00
|
|
|
]
|
|
|
|
|
2010-09-16 02:16:27 -05:00
|
|
|
texinfo_documents = [
|
|
|
|
('contents', 'sphinx', 'Sphinx Documentation', 'Georg Brandl',
|
|
|
|
'Sphinx', 'The Sphinx documentation builder.', 'Documentation tools',
|
|
|
|
1),
|
|
|
|
]
|
|
|
|
|
2018-06-09 22:59:43 -05:00
|
|
|
intersphinx_mapping = {'python': ('https://docs.python.org/3/', None)}
|
2010-08-05 06:39:23 -05:00
|
|
|
|
2013-03-30 22:22:08 -05:00
|
|
|
# Sphinx document translation with sphinx gettext feature uses these settings:
|
|
|
|
locale_dirs = ['locale/']
|
|
|
|
gettext_compact = False
|
|
|
|
|
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
|
|
|
|
2015-03-08 11:15:54 -05:00
|
|
|
from sphinx import addnodes # noqa
|
2008-04-06 12:38:55 -05:00
|
|
|
|
2008-05-31 11:14:36 -05:00
|
|
|
event_sig_re = re.compile(r'([a-zA-Z-]+)\s*\((.*)\)')
|
|
|
|
|
2015-03-08 11:15:54 -05:00
|
|
|
|
2008-05-31 11:14:36 -05:00
|
|
|
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')
|
2019-12-29 08:23:46 -06:00
|
|
|
app.add_object_type('setuptools-confval', 'setuptools-confval',
|
|
|
|
objname='setuptools configuration value',
|
|
|
|
indextemplate='pair: %s; setuptools configuration value')
|
2011-01-07 09:27:47 -06:00
|
|
|
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])
|
2018-09-20 06:17:21 -05:00
|
|
|
|
|
|
|
# workaround for RTD
|
|
|
|
from sphinx.util import logging
|
2018-09-20 06:27:25 -05:00
|
|
|
logger = logging.getLogger(__name__)
|
2018-09-20 06:32:41 -05:00
|
|
|
app.info = lambda *args, **kwargs: logger.info(*args, **kwargs)
|
|
|
|
app.warn = lambda *args, **kwargs: logger.warning(*args, **kwargs)
|
|
|
|
app.debug = lambda *args, **kwargs: logger.debug(*args, **kwargs)
|