From 62028d063ea81fc45d44f1efa4c34880978f8ce7 Mon Sep 17 00:00:00 2001 From: Nish Patwa Date: Mon, 19 Sep 2016 10:04:56 -0500 Subject: [PATCH] [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/ than watermark is . 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 --- doc/source/conf.py | 14 ++++++++++++-- tox.ini | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index aa7011ae24..d793e5e99a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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 diff --git a/tox.ini b/tox.ini index 0aa390f1e8..59d4e2e45e 100644 --- a/tox.ini +++ b/tox.ini @@ -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