2 Sphinx Read the Docs theme.
4 From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
8 from sys
import version_info
as python_version
10 from sphinx
import version_info
as sphinx_version
11 from sphinx.locale
import _
12 from sphinx.util.logging
import getLogger
15 __version__ =
'1.0.0alpha1'
16 __version_full__ = __version__
18 logger = getLogger(__name__)
22 """Return list of HTML theme paths."""
23 cur_dir = path.abspath(path.dirname(path.dirname(__file__)))
27 def config_initiated(app, config):
28 theme_options = config.html_theme_options
or {}
29 if theme_options.get(
'canonical_url'):
31 _(
'The canonical_url option is deprecated, use the html_baseurl option from Sphinx instead.')
38 if python_version[0] < 3:
39 logger.warning(
"Python 2 is deprecated with sphinx_rtd_theme, update to Python 3")
40 app.require_sphinx(
'1.6')
41 if sphinx_version <= (2, 0, 0):
42 logger.warning(
"Sphinx 1.x is deprecated with sphinx_rtd_theme, update to Sphinx 2.x or greater")
43 if not app.config.html_experimental_html5_writer:
44 logger.warning(
"'html4_writer' is deprecated with sphinx_rtd_theme")
46 if app.config.html4_writer:
47 logger.warning(
"'html4_writer' is deprecated with sphinx_rtd_theme")
50 app.add_html_theme(
'sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
52 if sphinx_version >= (1, 8, 0):
55 rtd_locale_path = path.join(path.abspath(path.dirname(__file__)),
'locale')
56 app.add_message_catalog(
'sphinx', rtd_locale_path)
57 app.connect(
'config-inited', config_initiated)
60 if sphinx_version >= (3, 5, 0):
61 app.config.html_permalinks_icon =
"\uf0c1"
63 app.config.html_add_permalinks =
"\uf0c1"
65 return {
'parallel_read_safe':
True,
'parallel_write_safe':
True}
def get_html_theme_path()