Skip to content

Commit

Permalink
Documentation: Use theme from Read The Docs.
Browse files Browse the repository at this point in the history
'ovs-sphinx-theme' is designed to look like an openvswitch.org
website.  It contains OVS logo and navigation bars from the
openvswitch.org.  And that doesn't really make a lot of sense
for OVN.  Also, currently the ovs-sphinx-theme is not actually
installed by the Read The Docs configuration, so the docs.ovn.org
is using default alabaster theme instead.

Switch to sphinx_rtd_theme, it looks close to the main ovn.org
website.  Remove the upper limit on sphinx version, because the
theme may require higher versions and also sphinx 2.0 is very old
and fails to be installed on Read The Docs servers.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
  • Loading branch information
igsilya authored and dceara committed Nov 15, 2023
1 parent 271186f commit e90b5d5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
22 changes: 7 additions & 15 deletions Documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import importlib
import string
import sys

try:
import ovs_sphinx_theme
use_ovs_theme = True
except ImportError:
print("Cannot find 'ovs-sphinx-theme' package. "
use_rtd_theme = importlib.util.find_spec('sphinx_rtd_theme') is not None
if not use_rtd_theme:
print("Cannot find 'sphinx_rtd_theme' package. "
"Falling back to default theme.")
use_ovs_theme = False

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

Expand All @@ -48,7 +46,7 @@

# General information about the project.
project = u'Open Virtual Network (OVN)'
copyright = u'2020, The Open Virtual Network (OVN) Development Community'
copyright = u'2020-2023, The Open Virtual Network (OVN) Development Community'
author = u'The Open Virtual Network (OVN) Development Community'

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -89,14 +87,8 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
if use_ovs_theme:
html_theme = 'ovs'

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

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
Expand Down
18 changes: 7 additions & 11 deletions Documentation/internals/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,13 @@ variety of other output formats but also allows for things like
cross-referencing and indexing. for more information on the two, refer to the
:doc:`contributing/documentation-style`.

ovs-sphinx-theme
sphinx_rtd_theme
----------------

The documentation uses its own theme, `ovs-sphinx-theme`, which can be found on
GitHub__ and is published on pypi__. This is shared by Open vSwitch and OVN.
It is packaged separately to ensure all documentation gets the latest version
of the theme (assuming there are no major version bumps in that package). If
building locally and the package is installed, it will be used. If the package
is not installed, Sphinx will fallback to the default theme.

The package is currently maintained by Stephen Finucane and Russell Bryant.
The documentation uses `sphinx_rtd_theme`, which can be found on GitHub__ and
is published on pypi__. It is also packaged in major distributions.
If building locally and the package is installed, it will be used. If the
package is not installed, Sphinx will fallback to the default theme.

Read the Docs
-------------
Expand All @@ -72,6 +68,6 @@ modifications to this site, refer to the `GitHub project`__.

__ http://docutils.sourceforge.net/rst.html
__ http://www.sphinx-doc.org/
__ https://github.com/openvswitch/ovs-sphinx-theme
__ https://pypi.python.org/pypi/ovs-sphinx-theme
__ https://github.com/readthedocs/sphinx_rtd_theme
__ https://pypi.python.org/pypi/sphinx_rtd_theme
__ https://github.com/ovn-org/ovn-org.github.io
4 changes: 2 additions & 2 deletions Documentation/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sphinx>=1.1,<2.0
ovs_sphinx_theme>=1.0,<1.1
sphinx>=1.1
sphinx_rtd_theme>=1.0,<2.0

0 comments on commit e90b5d5

Please sign in to comment.