From 7c71be4183da47a0d2f8f4fdf1c33293099addc3 Mon Sep 17 00:00:00 2001 From: Sergey Lukjanov Date: Mon, 7 Oct 2013 11:31:12 +0000 Subject: [PATCH] Add back copy-pasted theme for Read The Docs only This partially reverts commit 43a67fe05fcb6f3a70293996c80671884e969b21 Change-Id: I60746fa92fc89664f7ecea09f0d9cf3bf4899812 --- doc/source/_theme_rtd/layout.html | 4 ++++ doc/source/_theme_rtd/theme.conf | 4 ++++ doc/source/conf.py | 15 +++++++++++---- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 doc/source/_theme_rtd/layout.html create mode 100644 doc/source/_theme_rtd/theme.conf diff --git a/doc/source/_theme_rtd/layout.html b/doc/source/_theme_rtd/layout.html new file mode 100644 index 0000000000..cd7ade1d70 --- /dev/null +++ b/doc/source/_theme_rtd/layout.html @@ -0,0 +1,4 @@ +{% extends "basic/layout.html" %} +{% set css_files = css_files + ['_static/tweaks.css'] %} + +{% block relbar1 %}{% endblock relbar1 %} \ No newline at end of file diff --git a/doc/source/_theme_rtd/theme.conf b/doc/source/_theme_rtd/theme.conf new file mode 100644 index 0000000000..8c44b0ce46 --- /dev/null +++ b/doc/source/_theme_rtd/theme.conf @@ -0,0 +1,4 @@ +[theme] +inherit = nature +stylesheet = nature.css +pygments_style = tango \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index e3a3a6a34d..cf5c62e6bb 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -19,6 +19,8 @@ import sys import os +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -35,7 +37,10 @@ sys.path.append(os.path.abspath('../bin')) # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', - 'sphinx.ext.pngmath', 'sphinx.ext.viewcode', 'sphinxcontrib.httpdomain', 'oslo.sphinx'] + 'sphinx.ext.pngmath', 'sphinx.ext.viewcode', 'sphinxcontrib.httpdomain'] + +if not on_rtd: + extensions.append('oslo.sphinx') # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -51,7 +56,7 @@ master_doc = 'index' # General information about the project. project = u'Savanna' -copyright = u'2013, Mirantis Inc.' +copyright = u'2013, Mirantis Inc' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -102,8 +107,10 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -#html_theme_path = ['.'] -#html_theme = '_theme' + +if on_rtd: + html_theme_path = ['.'] + html_theme = '_theme_rtd' # 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