Commit 3ff1fa34 authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Be more flexible on how the stylesheet is added

parent a537c7f7
...@@ -11,17 +11,15 @@ from distutils.version import LooseVersion ...@@ -11,17 +11,15 @@ from distutils.version import LooseVersion
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
if LooseVersion(sphinx_version) > LooseVersion("1.6"): if LooseVersion(sphinx_version) > LooseVersion("1.6"):
def setup(app): def setup(app):
"""Called automatically by Sphinx when starting the build process """Called automatically by Sphinx when starting the build process
""" """
# Add support for multiple Sphinx versions if hasattr(app, 'add_css_file'): # >=v1.8
if hasattr(app, "add_css_file"):
app.add_css_file("custom.css") app.add_css_file("custom.css")
else: else:
app.add_stylesheet("custom.css") app.add_stylesheet("custom.css") # v1.6-1.8
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment