Skip to content

Commit

Permalink
doc: Use ovs theme
Browse files Browse the repository at this point in the history
The recently published 'ovs' theme [1] copies the styling of the Open
vSwitch website. Start using this, with fallbacks for users who do not
have the package installed.

This extends support for building docs to users of Sphinx 1.2 as the
previous theme - bizstyle - was only available in 1.3+.

[1] https://pypi.python.org/pypi/ovs-sphinx-theme

Signed-off-by: Stephen Finucane <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
stephenfin authored and blp committed Jan 4, 2017
1 parent 2974ce8 commit eeab45f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
20 changes: 16 additions & 4 deletions Documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
try:
import ovs_sphinx_theme
use_ovs_theme = True
except ImportError:
print("Cannot find 'ovs_sphinx' package. Falling back to default theme.")
use_ovs_theme = False

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
needs_sphinx = '1.2'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down Expand Up @@ -102,7 +108,7 @@
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# pygments_style = 'friendly'

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand All @@ -119,7 +125,10 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'bizstyle'
if use_ovs_theme:
html_theme = 'ovs'
else:
html_theme = 'default'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -128,7 +137,10 @@
# html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
if use_ovs_theme:
html_theme_path = [ovs_sphinx_theme.get_theme_dir()]
else:
html_theme_path = []

# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
Expand Down
3 changes: 2 additions & 1 deletion Documentation/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
sphinx>=1.3
sphinx>=1.2,<2.0
ovs_sphinx_theme>=1.0,<1.1

0 comments on commit eeab45f

Please sign in to comment.