2008-06-05 03:58:43 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2018-02-19 07:39:14 -06:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
from docutils import nodes
|
|
|
|
from docutils.parsers.rst import Directive
|
|
|
|
|
|
|
|
from sphinx import addnodes
|
|
|
|
|
2008-06-05 03:58:43 -05:00
|
|
|
|
|
|
|
sys.path.append(os.path.abspath('.'))
|
|
|
|
|
2010-01-02 13:54:59 -06:00
|
|
|
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.jsmath', 'sphinx.ext.todo',
|
2018-03-23 00:26:07 -05:00
|
|
|
'sphinx.ext.coverage', 'sphinx.ext.extlinks']
|
2009-01-10 15:32:54 -06:00
|
|
|
|
2008-08-06 09:57:44 -05:00
|
|
|
jsmath_path = 'dummy.js'
|
2008-06-05 03:58:43 -05:00
|
|
|
|
|
|
|
templates_path = ['_templates']
|
|
|
|
|
2015-03-08 07:11:28 -05:00
|
|
|
source_suffix = ['.txt', '.add', '.foo']
|
2008-06-05 03:58:43 -05:00
|
|
|
|
2008-11-23 08:22:09 -06:00
|
|
|
project = 'Sphinx <Tests>'
|
2016-01-14 15:54:04 -06:00
|
|
|
copyright = '2010-2016, Georg Brandl & Team'
|
2009-02-21 10:17:21 -06:00
|
|
|
# If this is changed, remember to update the versionchanges!
|
2009-01-10 15:32:54 -06:00
|
|
|
version = '0.6'
|
|
|
|
release = '0.6alpha1'
|
2008-06-05 03:58:43 -05:00
|
|
|
today_fmt = '%B %d, %Y'
|
2010-01-06 08:48:39 -06:00
|
|
|
exclude_patterns = ['_build', '**/excluded.*']
|
2008-08-10 12:10:31 -05:00
|
|
|
keep_warnings = True
|
2008-06-05 03:58:43 -05:00
|
|
|
pygments_style = 'sphinx'
|
2009-08-09 16:12:01 -05:00
|
|
|
show_authors = True
|
2014-10-01 21:17:34 -05:00
|
|
|
numfig = True
|
2008-06-05 03:58:43 -05:00
|
|
|
|
2009-02-07 12:41:10 -06:00
|
|
|
rst_epilog = '.. |subst| replace:: global substitution'
|
|
|
|
|
2017-10-31 08:57:28 -05:00
|
|
|
html_sidebars = {'**': ['localtoc.html', 'relations.html', 'sourcelink.html',
|
|
|
|
'customsb.html', 'searchbox.html'],
|
2018-09-03 07:38:31 -05:00
|
|
|
'index': ['contentssb.html', 'localtoc.html', 'globaltoc.html']}
|
2008-06-05 03:58:43 -05:00
|
|
|
html_style = 'default.css'
|
|
|
|
html_last_updated_fmt = '%b %d, %Y'
|
2009-12-31 02:47:56 -06:00
|
|
|
html_context = {'hckey': 'hcval', 'hckey_co': 'wrong_hcval_co'}
|
2008-11-04 01:34:35 -06:00
|
|
|
|
2008-06-05 03:58:43 -05:00
|
|
|
htmlhelp_basename = 'SphinxTestsdoc'
|
|
|
|
|
2015-01-15 07:17:01 -06:00
|
|
|
applehelp_bundle_id = 'org.sphinx-doc.Sphinx.help'
|
|
|
|
applehelp_disable_external_tools = True
|
|
|
|
|
2008-06-05 03:58:43 -05:00
|
|
|
latex_documents = [
|
2018-09-03 07:38:31 -05:00
|
|
|
('index', 'SphinxTests.tex', 'Sphinx Tests Documentation',
|
2014-09-21 10:34:16 -05:00
|
|
|
'Georg Brandl \\and someone else', 'manual'),
|
2008-06-05 03:58:43 -05:00
|
|
|
]
|
|
|
|
|
2009-02-20 04:20:15 -06:00
|
|
|
latex_additional_files = ['svgimg.svg']
|
|
|
|
|
2010-09-16 02:19:06 -05:00
|
|
|
texinfo_documents = [
|
2018-09-03 07:38:31 -05:00
|
|
|
('index', 'SphinxTests', 'Sphinx Tests',
|
2014-09-21 10:34:16 -05:00
|
|
|
'Georg Brandl \\and someone else', 'Sphinx Testing', 'Miscellaneous'),
|
2010-09-16 02:19:06 -05:00
|
|
|
]
|
|
|
|
|
2013-01-06 23:42:25 -06:00
|
|
|
man_pages = [
|
2018-09-03 07:38:31 -05:00
|
|
|
('index', 'SphinxTests', 'Sphinx Tests Documentation',
|
2013-01-06 23:42:25 -06:00
|
|
|
'Georg Brandl and someone else', 1),
|
|
|
|
]
|
|
|
|
|
2008-09-13 04:45:59 -05:00
|
|
|
coverage_c_path = ['special/*.h']
|
2010-01-17 12:21:04 -06:00
|
|
|
coverage_c_regexes = {'function': r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'}
|
2008-09-13 04:45:59 -05:00
|
|
|
|
2010-01-02 13:51:22 -06:00
|
|
|
extlinks = {'issue': ('http://bugs.python.org/issue%s', 'issue '),
|
|
|
|
'pyurl': ('http://python.org/%s', None)}
|
|
|
|
|
2013-10-23 03:36:45 -05:00
|
|
|
autodoc_mock_imports = [
|
|
|
|
'missing_module',
|
2018-01-11 13:53:35 -06:00
|
|
|
'missing_package1',
|
|
|
|
'missing_package2',
|
|
|
|
'missing_package3',
|
|
|
|
'sphinx.missing_module4',
|
2013-10-23 03:36:45 -05:00
|
|
|
]
|
|
|
|
|
2009-02-19 14:56:34 -06:00
|
|
|
# modify tags from conf.py
|
2018-02-19 07:39:14 -06:00
|
|
|
tags.add('confpytag') # NOQA
|
2009-02-18 15:12:03 -06:00
|
|
|
|
2014-09-21 10:34:16 -05:00
|
|
|
|
2018-02-19 07:39:14 -06:00
|
|
|
# -- extension API
|
2009-02-18 15:12:03 -06:00
|
|
|
def userdesc_parse(env, sig, signode):
|
|
|
|
x, y = sig.split(':')
|
|
|
|
signode += addnodes.desc_name(x, x)
|
|
|
|
signode += addnodes.desc_parameterlist()
|
|
|
|
signode[-1] += addnodes.desc_parameter(y, y)
|
|
|
|
return x
|
|
|
|
|
2014-09-21 10:34:16 -05:00
|
|
|
|
2009-10-27 13:42:44 -05:00
|
|
|
class ClassDirective(Directive):
|
|
|
|
option_spec = {'opt': lambda x: x}
|
2014-09-21 10:34:16 -05:00
|
|
|
|
2009-10-27 13:42:44 -05:00
|
|
|
def run(self):
|
|
|
|
return [nodes.strong(text='from class: %s' % self.options['opt'])]
|
|
|
|
|
2014-09-21 10:34:16 -05:00
|
|
|
|
2008-06-05 03:58:43 -05:00
|
|
|
def setup(app):
|
2018-01-21 20:38:24 -06:00
|
|
|
import parsermod
|
|
|
|
|
2009-10-27 13:42:44 -05:00
|
|
|
app.add_directive('clsdir', ClassDirective)
|
2009-10-27 13:58:40 -05:00
|
|
|
app.add_object_type('userdesc', 'userdescrole', '%s (userdesc)',
|
|
|
|
userdesc_parse, objname='user desc')
|
2018-05-22 10:37:54 -05:00
|
|
|
app.add_js_file('file://moo.js')
|
2018-02-11 06:13:32 -06:00
|
|
|
app.add_source_suffix('.foo', 'foo')
|
|
|
|
app.add_source_parser(parsermod.Parser)
|