diff --git a/doc/conf.py b/doc/conf.py index 72eeac0418071..f634be2950d90 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -111,7 +111,7 @@ # 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 # documentation. -#html_theme_options = {} +html_theme_options = {'oldversion':True} # Add any paths that contain custom themes here, relative to this directory. html_theme_path = ['themes'] diff --git a/doc/themes/scikit-learn/layout.html b/doc/themes/scikit-learn/layout.html index eb915728e7fde..50806d572330f 100644 --- a/doc/themes/scikit-learn/layout.html +++ b/doc/themes/scikit-learn/layout.html @@ -15,6 +15,15 @@ {%- endif %} {% block header %} + {%- if theme_oldversion|tobool %} +
+

Warning: This documentation is + for {{project}} version {{ release|e }}. + — + Latest stable version

+
+ {%- endif %} +
{%- if logo %} diff --git a/doc/themes/scikit-learn/static/nature.css_t b/doc/themes/scikit-learn/static/nature.css_t index 6181274c9391f..377278ead347b 100644 --- a/doc/themes/scikit-learn/static/nature.css_t +++ b/doc/themes/scikit-learn/static/nature.css_t @@ -34,7 +34,18 @@ div.header-wrapper { div.header { /* for the logo to correctly expand when showing results but remain cut when not */ - overflow: hidden; + overflow: hidden; +} + +/* -------- warning header for old versions --------------------------------*/ + +div.warning-wrapper { + background-color: #ffaaaa; + max-width: auto; + text-align: center; +} +div.warning-wrapper p { + margin: 0; } diff --git a/doc/themes/scikit-learn/theme.conf b/doc/themes/scikit-learn/theme.conf index 1cc40044646bb..e70d4c67d39d6 100644 --- a/doc/themes/scikit-learn/theme.conf +++ b/doc/themes/scikit-learn/theme.conf @@ -2,3 +2,6 @@ inherit = basic stylesheet = nature.css pygments_style = tango + +[options] +oldversion = False \ No newline at end of file