From 4f57aceb801ea6c33b3804ae5ffaa62ccfd0a0f8 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Sun, 10 Jun 2018 00:14:53 -0400 Subject: [PATCH] Add Report Issue ribbon Add a ribbon on the top right of the page which when clicked will direct the reader to LF Jira to open an issue with the doc. It also prefills the description with the version of dosc and current page the user was viewing when they clicked the ribbon. Change-Id: If8be81ec7a1c4a9b7b4ed21e5cafe65c98845e42 Signed-off-by: Thanh Ha --- docs/_static/css/ribbon.css | 36 ++++++++++++++++++++++++++++++++++++ docs/_templates/layout.html | 17 +++++++++++++++++ docs/conf.py | 3 +++ 3 files changed, 56 insertions(+) create mode 100644 docs/_static/css/ribbon.css create mode 100644 docs/_templates/layout.html diff --git a/docs/_static/css/ribbon.css b/docs/_static/css/ribbon.css new file mode 100644 index 0000000..e95d3bf --- /dev/null +++ b/docs/_static/css/ribbon.css @@ -0,0 +1,36 @@ +.ribbon { + z-index: 1000; + background-color: #a00; + overflow: hidden; + white-space: nowrap; + position: fixed; + top: 70px; + right: -50px; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); + -webkit-box-shadow: 0 0 10px #888; + -moz-box-shadow: 0 0 10px #888; + box-shadow: 0 0 10px #888; + +} + +.ribbon a { + border: 1px solid #faa; + color: #fff; + display: block; + font: bold 81.25% 'Helvetica Neue', Helvetica, Arial, sans-serif; + margin: 1px 0; + padding: 10px 50px; + text-align: center; + text-decoration: none; + text-shadow: 0 0 5px #444; + transition: 0.5s; +} + +.ribbon a:hover { + background: #c11; + color: #fff; +} diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html new file mode 100644 index 0000000..9f337f0 --- /dev/null +++ b/docs/_templates/layout.html @@ -0,0 +1,17 @@ +{# Import the theme's layout. #} +{% extends "!layout.html" %} + +{# Ribbon #} +{% block content %} + + {{ super() }} +{% endblock %} diff --git a/docs/conf.py b/docs/conf.py index 951d14b..859ba7e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,3 +30,6 @@ linkcheck_ignore = [ 'https://.*.example.org.*', 'https://git.opendaylight.org/gerrit/#/settings/gpg-keys', ] + +def setup(app): + app.add_stylesheet("css/ribbon.css") -- 2.16.6