From a530e381d1d54538c0de114e388b2ddd280d266f Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 17 Apr 2015 11:30:43 +0200 Subject: [PATCH] Fix RST conf.py for "Log a bug" Follow Ib60146d993ff67fc3f8fd8703cdad1935f7ec6bb and set variables so that "Log a bug" link works. Change-Id: Ib4fcd3ba8e47dcb91e7f2e7dcaec29a513a8e43b --- doc/networking-guide/source/conf.py | 20 ++++++++++++++++---- doc/user-guides/source/conf.py | 15 ++++++++++++++- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/doc/networking-guide/source/conf.py b/doc/networking-guide/source/conf.py index 3252389257..0cb31314ef 100644 --- a/doc/networking-guide/source/conf.py +++ b/doc/networking-guide/source/conf.py @@ -20,7 +20,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -# import os +import os # import sys import openstackdocstheme @@ -61,9 +61,18 @@ copyright = u'2015, OpenStack contributors' # built documents. # # The short X.Y version. -version = '0.0.1' +version = '0.1.0' # The full version, including alpha/beta/rc tags. -release = '0.0.1' +release = '0.1.0' + +# We ask git for the SHA checksum +# The git SHA checksum is used by "log-a-bug" +git_cmd = "/usr/bin/git log | head -n1 | cut -f2 -d' '" +gitsha = os.popen(git_cmd).read().strip('\n') +# source tree +pwd = os.popen("pwd").read().strip('\n') +# html_context allows us to pass arbitrary values into the html template +html_context = {"pwd": pwd, "gitsha": gitsha} # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -146,7 +155,10 @@ html_theme_path = [openstackdocstheme.get_html_theme_path()] # 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' +# So that we can enable "log-a-bug" links from each output HTML page, this +# variable must be set to a format that includes year, month, day, hours and +# minutes. +html_last_updated_fmt = '%Y-%m-%d %H:%M' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. diff --git a/doc/user-guides/source/conf.py b/doc/user-guides/source/conf.py index 8829399ff1..3ebceedd20 100644 --- a/doc/user-guides/source/conf.py +++ b/doc/user-guides/source/conf.py @@ -82,6 +82,15 @@ version = '1.0.0' # The full version, including alpha/beta/rc tags. release = '1.0.0' +# We ask git for the SHA checksum +# The git SHA checksum is used by "log-a-bug" +git_cmd = "/usr/bin/git log | head -n1 | cut -f2 -d' '" +gitsha = os.popen(git_cmd).read().strip('\n') +# source tree +pwd = os.popen("pwd").read().strip('\n') +# html_context allows us to pass arbitrary values into the html template +html_context = {"pwd": pwd, "gitsha": gitsha} + # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None @@ -163,7 +172,11 @@ html_theme_path = [openstackdocstheme.get_html_theme_path()] # 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' +# So that we can enable "log-a-bug" links from each output HTML page, this +# variable must be set to a format that includes year, month, day, hours and +# minutes. +html_last_updated_fmt = '%Y-%m-%d %H:%M' + # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities.