From a24941a94375fceff912698547f5f484072ad833 Mon Sep 17 00:00:00 2001 From: Sharat Sharma Date: Fri, 25 Nov 2016 21:59:35 +0530 Subject: [PATCH] Add timestamp at the bottom of every page This patch adds the timestamp at the bottom of every page using the given time format. Change-Id: Ie54165cc181cd4c959e803438a2bf33b5ec02730 --- doc/source/conf.py | 9 +++++++++ test-requirements.txt | 1 + 2 files changed, 10 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 4cffe2753..98c21148a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -13,6 +13,7 @@ # limitations under the License. import os +import subprocess import sys @@ -94,6 +95,14 @@ htmlhelp_basename = '%sdoc' % project # A list of ignored prefixes for module index sorting. modindex_common_prefix = ['mistral.'] +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' +git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", + "-n1"] +html_last_updated_fmt = subprocess.Popen( + git_cmd, stdout=subprocess.PIPE).communicate()[0] + # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". html_title = 'Mistral' diff --git a/test-requirements.txt b/test-requirements.txt index 1860e341e..0108442ba 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,6 +12,7 @@ requests-mock>=1.1 # Apache-2.0 sphinx!=1.3b1,<1.4,>=1.2.1 # BSD sphinxcontrib-httpdomain # BSD sphinxcontrib-pecanwsme>=0.8 # Apache-2.0 +openstackdocstheme>=1.5.0 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD testtools>=1.4.0 # MIT unittest2 # BSD