sprockets.mixins.mediatype/docs/conf.py

62 lines
2.3 KiB
Python
Raw Permalink Normal View History

import os
import pkg_resources
2015-06-08 20:28:30 +00:00
needs_sphinx = '4.0'
extensions = ['sphinx.ext.viewcode', 'sphinxcontrib.httpdomain']
2015-06-08 20:28:30 +00:00
master_doc = 'index'
project = 'sprockets.mixins.mediatype'
2021-09-15 10:36:38 +00:00
copyright = '2015-2021, AWeber Communications'
release = pkg_resources.get_distribution('sprockets.mixins.mediatype').version
2015-06-08 20:28:30 +00:00
version = '.'.join(release.split('.')[0:1])
# Only install the ReadTheDocs theme when we are not running
# in the RTD build system.
if not os.environ.get('READTHEDOCS', None):
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
2015-08-19 22:29:32 +00:00
html_sidebars = {
'**': ['about.html', 'navigation.html'],
}
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html
extensions.append('sphinx.ext.intersphinx')
2015-06-08 20:28:30 +00:00
intersphinx_mapping = {
'ietfparse': ('https://ietfparse.readthedocs.io/en/latest', None),
'python': ('https://docs.python.org/3', None),
2015-06-08 20:28:30 +00:00
'requests': ('https://requests.readthedocs.org/en/latest/', None),
'sprockets': ('https://sprockets.readthedocs.org/en/latest/', None),
'tornado': ('https://www.tornadoweb.org/en/stable/', None),
2015-06-08 20:28:30 +00:00
}
2021-09-12 13:19:59 +00:00
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
# We need to define type aliases for both the simple name (e.g., Deserialized)
# and the prefixed name (e.g., type_info.Deserialized) since both forms
# appear in the typing annotations.
extensions.append('sphinx.ext.autodoc')
autodoc_type_aliases = {
alias: f'sprockets.mixins.mediatype.type_info.{alias}'
for alias in {
'DefinesIsoFormat', 'Deserialized', 'DumpSFunction', 'HasSettings',
'LoadSFunction', 'MsgPackable', 'PackBFunction', 'Serializable',
'Transcoder', 'UnpackBFunction'
}
}
autodoc_type_aliases.update({
f'type_info.{alias}': f'sprockets.mixins.mediatype.type_info.{alias}'
for alias in {
'DefinesIsoFormat', 'Deserialized', 'DumpSFunction', 'HasSettings',
'LoadSFunction', 'MsgPackable', 'PackBFunction', 'Serializable',
'Transcoder', 'UnpackBFunction'
}
})
2021-09-12 13:19:59 +00:00
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
extensions.append('sphinx.ext.extlinks')
2021-09-12 13:19:59 +00:00
extlinks = {
'compare': ('https://github.com/sprockets/sprockets.mixins.mediatype'
'/compare/%s', '%s')
}