[openstack-dev] [Sphinx] [ReadTheDocs] How to change the default Sphinx theme in a docs gate job?

Mikhail Dubov mdubov at mirantis.com
Mon Jan 12 11:25:28 UTC 2015

Hi all,

when it gets to submitting & reviewing patches for the project
documentation, it is very convenient to surf through the docs generated by
Sphinx in a special Gate job. The problem is that Sphinx uses in gates a
theme which is different from that used on ReadTheDocs. So the docs
generated in gates look differently from the docs that we have on
ReadTheDocs, while the desired behaviour is to have the same Sphinx theme
both on ReadTheDocs and in gates.

There is a snippet
<http://read-the-docs.readthedocs.org/en/latest/theme.html> that enables
the default ReadTheDocs theme locally (and also potentially in gates):

# on_rtd is whether we are on readthedocs.org
import oson_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd:  # only import and set the theme if we're building docs locally
    import sphinx_rtd_theme
    html_theme = 'sphinx_rtd_theme'
    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# otherwise, readthedocs.org uses their theme by default, so no need
to specify it

The problem is that it uses the sphinx_rtd_theme
<https://pypi.python.org/pypi/sphinx_rtd_theme> python package, which is
not included in the global requirements. What should be done then to enable
that default ReadTheDocs theme in gates?

Best regards,
Mikhail Dubov

Engineering OPS
Mirantis, Inc.
E-Mail: mdubov at mirantis.com
Skype: msdubov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150112/d57a6b87/attachment.html>

More information about the OpenStack-dev mailing list