Update OPNFV Sphinx Theme 49/56349/1
authorTrevor Bramwell <tbramwell@linuxfoundation.org>
Wed, 28 Mar 2018 17:27:51 +0000 (10:27 -0700)
committerSofia Wallin <sofia.wallin@ericsson.com>
Tue, 24 Apr 2018 11:12:41 +0000 (11:12 +0000)
When the theme was initially created I was under the assumption the
directory the theme lives under needs to match the name. This does not
seem to be the case and in fact seems to cause issues with correctly
importing and using the theme.

Includes formatting updates to the README and linting.

Change-Id: I67c834bfe9dc99252159394ecbf136d9a264e0a8
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
(cherry picked from commit bd331b2451a17eaf5ed8f6fc8aa89f0499031c28)

opnfv-theme/MANIFEST.in
opnfv-theme/README.rst
opnfv-theme/setup.py
opnfv-theme/sphinx_opnfv_theme/__init__.py
opnfv-theme/sphinx_opnfv_theme/layout.html [moved from opnfv-theme/sphinx_opnfv_theme/opnfv/layout.html with 100% similarity]
opnfv-theme/sphinx_opnfv_theme/my_custom_sidebar.html [moved from opnfv-theme/sphinx_opnfv_theme/opnfv/my_custom_sidebar.html with 100% similarity]
opnfv-theme/sphinx_opnfv_theme/relations.html [moved from opnfv-theme/sphinx_opnfv_theme/opnfv/relations.html with 100% similarity]
opnfv-theme/sphinx_opnfv_theme/static/favicon.ico [moved from opnfv-theme/sphinx_opnfv_theme/opnfv/static/favicon.ico with 100% similarity]
opnfv-theme/sphinx_opnfv_theme/static/logo.png [moved from opnfv-theme/sphinx_opnfv_theme/opnfv/static/logo.png with 100% similarity]
opnfv-theme/sphinx_opnfv_theme/static/my-styles.css [moved from opnfv-theme/sphinx_opnfv_theme/opnfv/static/my-styles.css with 100% similarity]
opnfv-theme/sphinx_opnfv_theme/theme.conf [moved from opnfv-theme/sphinx_opnfv_theme/opnfv/theme.conf with 100% similarity]

index a5886cd..34bc066 100644 (file)
@@ -2,6 +2,6 @@ include *.txt
 include *.rst
 
 recursive-include sphinx_opnfv_theme *
-recursive-include sphinx_opnfv_theme/opnfv *
+recursive-include sphinx_opnfv_theme/static *
 
 global-exclude *.pyc
index 484a7a7..c307768 100644 (file)
@@ -12,21 +12,23 @@ Here's how to install the theme from PyPI_
 
 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
 -------------
@@ -39,7 +41,7 @@ following options for the bootstrap theme::
 
   html_theme_options = {
     'bootswatch_theme': 'journal',
-    'navbar_sidebarrel': false,
+    'navbar_sidebarrel': False,
     'navbar_title': '',
   }
 
index 5375c09..55f55bc 100644 (file)
@@ -2,29 +2,29 @@ from setuptools import setup, find_packages
 
 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',
+    ]},
 )
index 0079275..2bf05c3 100644 (file)
@@ -2,7 +2,7 @@
 
 from os import path
 
-__version__='0.1.1'
+__version__ = '0.2.0'
 
 
 def get_html_theme_path():
@@ -10,6 +10,7 @@ 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__)))