Imported Upstream version 1.46.0
[platform/upstream/nghttp2.git] / doc / _themes / sphinx_rtd_theme / __init__.py
1 """
2 Sphinx Read the Docs theme.
3
4 From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
5 """
6
7 from os import path
8
9 import sphinx
10
11
12 __version__ = '0.5.0'
13 __version_full__ = __version__
14
15
16 def get_html_theme_path():
17     """Return list of HTML theme paths."""
18     cur_dir = path.abspath(path.dirname(path.dirname(__file__)))
19     return cur_dir
20
21
22 # See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
23 def setup(app):
24     if sphinx.version_info >= (1, 6, 0):
25         # Register the theme that can be referenced without adding a theme path
26         app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
27
28     if sphinx.version_info >= (1, 8, 0):
29         # Add Sphinx message catalog for newer versions of Sphinx
30         # See http://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_message_catalog
31         rtd_locale_path = path.join(path.abspath(path.dirname(__file__)), 'locale')
32         app.add_message_catalog('sphinx', rtd_locale_path)
33
34     return {'parallel_read_safe': True, 'parallel_write_safe': True}