sphinx/tests/roots/test-root/conf.py

109 lines
2.8 KiB
Python
Raw Normal View History

# -*- 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
sys.path.append(os.path.abspath('.'))
2010-01-02 13:54:59 -06:00
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.jsmath', 'sphinx.ext.todo',
'sphinx.ext.coverage', 'sphinx.ext.extlinks']
2008-08-06 09:57:44 -05:00
jsmath_path = 'dummy.js'
templates_path = ['_templates']
source_suffix = ['.txt', '.add', '.foo']
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'
# If this is changed, remember to update the versionchanges!
version = '0.6'
release = '0.6alpha1'
today_fmt = '%B %d, %Y'
exclude_patterns = ['_build', '**/excluded.*']
keep_warnings = True
pygments_style = 'sphinx'
2009-08-09 16:12:01 -05:00
show_authors = True
2014-10-01 21:17:34 -05:00
numfig = True
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'],
'index': ['contentssb.html', 'localtoc.html', 'globaltoc.html']}
html_style = 'default.css'
html_last_updated_fmt = '%b %d, %Y'
html_context = {'hckey': 'hcval', 'hckey_co': 'wrong_hcval_co'}
htmlhelp_basename = 'SphinxTestsdoc'
2015-01-15 07:17:01 -06:00
applehelp_bundle_id = 'org.sphinx-doc.Sphinx.help'
applehelp_disable_external_tools = True
latex_documents = [
('index', 'SphinxTests.tex', 'Sphinx Tests Documentation',
'Georg Brandl \\and someone else', 'manual'),
]
latex_additional_files = ['svgimg.svg']
2010-09-16 02:19:06 -05:00
texinfo_documents = [
('index', 'SphinxTests', 'Sphinx Tests',
'Georg Brandl \\and someone else', 'Sphinx Testing', 'Miscellaneous'),
2010-09-16 02:19:06 -05:00
]
man_pages = [
('index', 'SphinxTests', 'Sphinx Tests Documentation',
'Georg Brandl and someone else', 1),
]
coverage_c_path = ['special/*.h']
2010-01-17 12:21:04 -06:00
coverage_c_regexes = {'function': r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'}
extlinks = {'issue': ('http://bugs.python.org/issue%s', 'issue '),
'pyurl': ('http://python.org/%s', None)}
autodoc_mock_imports = [
'missing_module',
'missing_package1',
'missing_package2',
'missing_package3',
'sphinx.missing_module4',
]
# modify tags from conf.py
2018-02-19 07:39:14 -06:00
tags.add('confpytag') # NOQA
2018-02-19 07:39:14 -06:00
# -- extension API
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
class ClassDirective(Directive):
option_spec = {'opt': lambda x: x}
def run(self):
return [nodes.strong(text='from class: %s' % self.options['opt'])]
def setup(app):
import parsermod
app.add_directive('clsdir', ClassDirective)
app.add_object_type('userdesc', 'userdescrole', '%s (userdesc)',
userdesc_parse, objname='user desc')
app.add_js_file('file://moo.js')
app.add_source_suffix('.foo', 'foo')
app.add_source_parser(parsermod.Parser)