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