Belle II Software release-09-00-00
sphinx_rtd_theme Namespace Reference

Functions

def get_html_theme_path ()
 
def config_initiated (app, config)
 
def setup (app)
 

Variables

str __version__ = '1.0.0alpha1'
 
str __version_full__ = __version__
 
getLogger logger = getLogger(__name__)
 

Detailed Description

Sphinx Read the Docs theme.

From https://github.com/ryan-roemer/sphinx-bootstrap-theme.

Function Documentation

◆ config_initiated()

def config_initiated (   app,
  config 
)

Definition at line 27 of file __init__.py.

27def config_initiated(app, config):
28 theme_options = config.html_theme_options or {}
29 if theme_options.get('canonical_url'):
30 logger.warning(
31 _('The canonical_url option is deprecated, use the html_baseurl option from Sphinx instead.')
32 )
33
34# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
35
36

◆ get_html_theme_path()

def get_html_theme_path ( )
Return list of HTML theme paths.

Definition at line 21 of file __init__.py.

21def get_html_theme_path():
22 """Return list of HTML theme paths."""
23 cur_dir = path.abspath(path.dirname(path.dirname(__file__)))
24 return cur_dir
25
26

◆ setup()

def setup (   app)

Definition at line 37 of file __init__.py.

37def setup(app):
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")
45 else:
46 if app.config.html4_writer:
47 logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")
48
49 # Register the theme that can be referenced without adding a theme path
50 app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
51
52 if sphinx_version >= (1, 8, 0):
53 # Add Sphinx message catalog for newer versions of Sphinx
54 # See http://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_message_catalog
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)
58
59 # sphinx emits the permalink icon for headers, so choose one more in keeping with our theme
60 if sphinx_version >= (3, 5, 0):
61 app.config.html_permalinks_icon = "\uf0c1"
62 else:
63 app.config.html_add_permalinks = "\uf0c1"
64
65 return {'parallel_read_safe': True, 'parallel_write_safe': True}

Variable Documentation

◆ __version__

str __version__ = '1.0.0alpha1'
private

Definition at line 15 of file __init__.py.

◆ __version_full__

str __version_full__ = __version__
private

Definition at line 16 of file __init__.py.

◆ logger

getLogger logger = getLogger(__name__)

Definition at line 18 of file __init__.py.