diff --git a/doc/source/conf.py b/doc/source/conf.py index 8f9276d5..8bf60636 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -14,6 +14,7 @@ import sys import os +import openstackdocstheme # 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 @@ -55,6 +56,20 @@ version = '1.0' # The full version, including alpha/beta/rc tags. release = '1.0' +# A few variables have to be set for the log-a-bug feature. +# giturl: The location of conf.py on Git. Must be set manually. +# gitsha: The SHA checksum of the bug description. Automatically extracted from git log. +# bug_tag: Tag for categorizing the bug. Must be set manually. +# pwd: source tree - this is needed only for openstackdocstheme <= 1.2.2 +# These variables are passed to the logabug code via html_context. +bug_tag = 'refstack' +giturl = u'https://git.openstack.org/cgit/openstack/refstack/tree/doc/source' +git_cmd = "/usr/bin/git log | head -n1 | cut -f2 -d' '" +gitsha = os.popen(git_cmd).read().strip('\n') +html_context = {"gitsha": gitsha, "bug_tag": bug_tag, + "giturl": giturl, + "bug_project": "refstack"} + # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None @@ -98,7 +113,7 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'nature' +html_theme = 'openstackdocs' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -107,6 +122,7 @@ html_theme = 'nature' # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] +html_theme_path = [openstackdocstheme.get_html_theme_path()] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". @@ -137,6 +153,10 @@ html_theme = 'nature' # 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/test-requirements.txt b/test-requirements.txt index 9295d3b7..32375904 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,3 +12,4 @@ testrepository>=0.0.18 testtools>=0.9.34 pep257>=0.5.0 PyMySQL>=0.6.2,!=0.6.4 +openstackdocstheme>=1.5.0 # Apache-2.0