[DOCS] Added release-name as a watermark to Docs.

Added a water mark to install-guide, developer-docs, upgrade-guide
and releasenotes to make clear to deployers which release they're
working with.

Modified conf.py that adds watermark to the documentation according
to particular branch. If the current branch is master than
watermark is 'Pre-release' and if the current branch is
stable/<release-name> than watermark is <release-name>.

As global-requirements does not have sphinxmark included in
stable/newton [1], the requirements is added in tox.ini.

I will replicate this patch to all the role documentation once its
gets merged to master.

[1] https://review.openstack.org/376429

Closes-Bug:1624489
Change-Id: If454938abb4990764076436cd428673b456eab3c
This commit is contained in:
Nish Patwa 2016-09-19 10:04:56 -05:00 committed by Jesse Pretorius (odyssey4me)
parent d98eb49edc
commit 62028d063e
2 changed files with 13 additions and 2 deletions

View File

@ -25,7 +25,6 @@
import openstackdocstheme
import os
import pbr.version
from subprocess import Popen, PIPE
import sys
# If extensions (or modules to document with autodoc) are in another directory,
@ -42,7 +41,7 @@ sys.path.insert(0, os.path.abspath('../../playbooks/inventory/'))
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
# TODO(ajaeger): enable PDF building, for example add 'rst2pdf.pdfbuilder'
extensions = ['sphinx.ext.autodoc']
extensions = ['sphinx.ext.autodoc','sphinxmark']
# Add any paths that contain templates here, relative to this directory.
#templates_path = ['_templates']
@ -328,3 +327,14 @@ rst_epilog = """
current_release_formal_name,
upgrade_backup_dir,
latest_tag)
watermark = os.popen("git branch --contains $(git rev-parse HEAD) | awk -F/ '/stable/ {print $2}'").read().strip(' \n\t').capitalize()
if watermark == "":
watermark = "Pre-release"
# -- Options for sphinxmark -----------------------------------------------
sphinxmark_enable = True
sphinxmark_div = 'docs-body'
sphinxmark_image = 'text'
sphinxmark_text = watermark
sphinxmark_text_size = 70

View File

@ -11,6 +11,7 @@ install_command =
pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps =
-r{toxinidir}/test-requirements.txt
sphinxmark>=0.1.14
passenv =
HOME
http_proxy