[DOCS] Added release-name as a watermark to Docs.
Added a water mark to galera role documentation 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>. This is a combined implementation based on the following patches: - https://review.openstack.org/372565 - https://review.openstack.org/382637 - https://review.openstack.org/384140 Related-Bug: #1624489 Change-Id: Idf26db677a71bc9b3e1d22b4ca86bb7d2e5cd232
This commit is contained in:
parent
aa2354d476
commit
df246885d0
@ -23,6 +23,7 @@
|
||||
# serve to show the default.
|
||||
|
||||
import pbr.version
|
||||
import os
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
@ -39,7 +40,8 @@ import pbr.version
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'oslosphinx'
|
||||
'oslosphinx',
|
||||
'sphinxmark'
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
@ -303,3 +305,15 @@ texinfo_documents = [
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
# texinfo_no_detailmenu = False
|
||||
|
||||
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_color = (128, 128, 128)
|
||||
sphinxmark_text_size = 70
|
||||
|
@ -13,3 +13,4 @@ sphinx!=1.3b1,<1.4,>=1.2.1 # BSD
|
||||
oslosphinx>=4.7.0 # Apache-2.0
|
||||
doc8 # Apache-2.0
|
||||
reno>=1.8.0 # Apache2
|
||||
sphinxmark>=0.1.14 # Apache-2.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user