To install and configure the theme do the following.
-#. Install the theme from pypi::
+#. Install the theme from pypi:
- $ pip install sphinx_opnfv_theme
+ .. code-block:: bash
+
+ $ pip install sphinx_opnfv_theme
#. Configure Sphinx to use the theme:
-.. code-block:: python
+ .. code-block:: python
- # conf.py
- import sphinx_opnfv_theme
+ # conf.py
+ import sphinx_opnfv_theme
- # ...
+ # ...
- html_theme = 'opnfv'
- html_theme_path = sphinx_opnfv_theme.get_html_theme_path()
+ html_theme = 'opnfv'
+ html_theme_path = sphinx_opnfv_theme.get_html_theme_path()
Customization
-------------
html_theme_options = {
'bootswatch_theme': 'journal',
- 'navbar_sidebarrel': false,
+ 'navbar_sidebarrel': False,
'navbar_title': '',
}
from sphinx_opnfv_theme import __version__
-with open('README.rst') as f:
- readme_text = f.read()
setup(
name='sphinx_opnfv_theme',
description="OPNFV Theme for Sphinx",
- long_description=readme_text,
+ long_description=open('README.rst').read(),
url='https://docs.opnfv.org/',
author='Trevor Bramwell',
author_email='tbramwell@linuxfoundation.org',
version=__version__,
- entry_points = {
+ entry_points={
'sphinx.html_themes': [
'opnfv = sphinx_opnfv_theme',
]
},
packages=find_packages(),
- install_requires = [
+ install_requires=[
'sphinx_bootstrap_theme',
- 'sphinxcontrib.httpdomain',
+ 'sphinxcontrib-httpdomain',
],
include_package_data=True,
- package_data = {
- 'sphinx_opnfv_theme': ['opnfv/**',]
- },
+ package_data={'sphinx_opnfv_theme': [
+ 'theme.conf',
+ 'static/*',
+ '*.html',
+ ]},
)
from os import path
-__version__='0.1.1'
+__version__ = '0.2.0'
def get_html_theme_path():
local_path = path.abspath(path.dirname(__file__))
return [local_path]
+
def setup(app):
"""Required by Sphinx to create the theme."""
app.add_html_theme('opnfv', path.abspath(path.dirname(__file__)))