From 2969174191a3180356fcefe9611b955aef606377 Mon Sep 17 00:00:00 2001 From: Rob Cresswell Date: Mon, 10 Jul 2017 18:26:16 +0100 Subject: [PATCH] Add support for versionadded and deprecated This patch adds support for the versionadded, versionchanged and deprecated tags. It also reduces the rather aggressive margins and padding around the admonitions, so that they stack a little better, and adds a missing icon to the 'seealso' admonition. Adds example admonitions to the Demo documentation. Change-Id: Ieb064b26980f885549660a80e2a2578b71a5e7b7 --- doc/source/demo/index.rst | 18 +++++++++++++++++ .../openstackdocs/static/css/combined.css | 20 +++++++++++++++++-- .../theme/openstackdocs/static/js/docs.js | 10 +++++++--- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/doc/source/demo/index.rst b/doc/source/demo/index.rst index e923dd2..ef68253 100644 --- a/doc/source/demo/index.rst +++ b/doc/source/demo/index.rst @@ -91,9 +91,27 @@ Notices take these forms: .. caution:: Helpful information that prevents the user from making mistakes. +.. seealso:: + + A reference to another piece of related information, like a + related setting or upstream documentation + .. warning:: Critical information about the risk of data loss or security issues. +Configuration addition and deprecation notices +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 9.0.0(Mitaka) + +.. versionchanged:: 10.0.0(Newton) + + Added supported for new tags! + +.. deprecated:: 11.0.0(Ocata) + + Use `Notices`_ instead. + .. toctree:: :maxdepth: 1 diff --git a/openstackdocstheme/theme/openstackdocs/static/css/combined.css b/openstackdocstheme/theme/openstackdocs/static/css/combined.css index d8aeb55..87f651e 100644 --- a/openstackdocstheme/theme/openstackdocs/static/css/combined.css +++ b/openstackdocstheme/theme/openstackdocs/static/css/combined.css @@ -4192,8 +4192,12 @@ pre .cl { background: #eee; border-left: 4px solid; border-radius: 4px; - padding: 20px; - margin: 30px 0; } + padding: 15px; + margin: 15px 0; } + +.admonition > .last { + margin: 0; +} .admonition h3 { font-size: 18px; @@ -4247,6 +4251,18 @@ pre .cl { font-weight: 600; } +.versionadded { + color: #3C763D; +} + +.versionchanged { + color: #31708f; +} + +.deprecated { + color: #DA422F; +} + .docs-tags { width: 100%; margin-bottom: 30px; } diff --git a/openstackdocstheme/theme/openstackdocs/static/js/docs.js b/openstackdocstheme/theme/openstackdocs/static/js/docs.js index 2cd84a0..fa27c07 100644 --- a/openstackdocstheme/theme/openstackdocs/static/js/docs.js +++ b/openstackdocstheme/theme/openstackdocs/static/js/docs.js @@ -90,9 +90,13 @@ $('a').click(function(){ and warning. We decorate their title paragraphs with Font Awesome icons by adding the appropriate FA classes. */ -$('div.important > p.admonition-title').prepend('
 
'); -$('div.note > p.admonition-title').prepend('
 
'); -$('div.warning > p.admonition-title').prepend('
 
'); +$('div.important > p.admonition-title').prepend('
 
'); +$('div.note > p.admonition-title').prepend('
 
'); +$('div.seealso > p.admonition-title').prepend('
 
'); +$('div.warning > p.admonition-title').prepend('
 
'); +$('div.versionadded > p').prepend('
 
'); +$('div.versionchanged > p').prepend('
 
'); +$('div.deprecated > p').prepend('
 
'); /* BB 150310 We also insert a space between the icon and the admonition title