sphinx_rtd_theme/docs/conf.py

95 lines
2.1 KiB
Python
Raw Normal View History

2013-11-03 15:37:56 -06:00
# -*- coding: utf-8 -*-
2017-03-14 22:52:32 -05:00
import sys
import os
import re
2017-12-20 22:29:52 -06:00
sys.path.insert(0, os.path.abspath('..'))
2017-12-20 22:16:03 -06:00
sys.path.append(os.path.abspath('./demo/'))
2013-11-03 21:39:37 -06:00
from sphinx.locale import _
from sphinx_rtd_theme import __version__
2013-11-03 15:37:56 -06:00
project = u'Read the Docs Sphinx Theme'
slug = re.sub(r'\W+', '-', project.lower())
version = __version__
release = __version__
author = u'Dave Snider, Read the Docs, Inc. & contributors'
copyright = author
language = 'en'
2013-11-03 15:37:56 -06:00
2013-11-04 22:02:16 -06:00
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinxcontrib.httpdomain',
'sphinx_rtd_theme',
2013-11-04 22:02:16 -06:00
]
2013-11-03 15:37:56 -06:00
templates_path = ['_templates']
source_suffix = '.rst'
exclude_patterns = []
locale_dirs = ['locale/']
gettext_compact = False
2013-11-03 15:37:56 -06:00
master_doc = 'index'
suppress_warnings = ['image.nonlocal_uri']
pygments_style = 'default'
2013-11-03 15:37:56 -06:00
intersphinx_mapping = {
'rtd': ('https://docs.readthedocs.io/en/latest/', None),
2019-01-22 16:20:23 -06:00
'sphinx': ('http://www.sphinx-doc.org/en/stable/', None),
}
2013-11-03 15:37:56 -06:00
html_theme = 'sphinx_rtd_theme'
2014-01-05 16:17:41 -06:00
html_theme_options = {
'logo_only': True
2014-01-05 16:17:41 -06:00
}
html_theme_path = ["../.."]
2017-12-20 22:29:52 -06:00
html_logo = "demo/static/logo-wordmark-light.svg"
html_show_sourcelink = True
2013-11-03 15:37:56 -06:00
htmlhelp_basename = slug
2013-11-03 15:37:56 -06:00
latex_documents = [
('index', '{0}.tex'.format(slug), project, author, 'manual'),
2013-11-03 15:37:56 -06:00
]
man_pages = [
('index', slug, project, [author], 1)
2013-11-03 15:37:56 -06:00
]
texinfo_documents = [
('index', slug, project, author, slug, project, 'Miscellaneous'),
2013-11-03 15:37:56 -06:00
]
# Extensions to theme docs
def setup(app):
from sphinx.domains.python import PyField
from sphinx.util.docfields import Field
app.add_object_type(
'confval',
'confval',
objname='configuration value',
indextemplate='pair: %s; configuration value',
doc_field_types=[
PyField(
'type',
label=_('Type'),
has_arg=False,
names=('type',),
bodyrolename='class'
),
Field(
'default',
label=_('Default'),
has_arg=False,
names=('default',),
),
]
)