Update docs theme configuration

Enable log-a-bug feature and add information on when document was built.

Disable pep8 check for doc/source/conf.py.

Change-Id: Ia86791ac69845572b2fbc536732afcf901bcf203
This commit is contained in:
Andreas Jaeger 2017-04-30 09:17:45 +02:00
parent d3bc42483a
commit ea1ae95b63
2 changed files with 20 additions and 1 deletions

View File

@ -41,6 +41,18 @@ master_doc = 'index'
project = u'openstack-doc-tools'
copyright = u'2017, OpenStack Foundation'
# 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.
# These variables are passed to the logabug code via html_context.
giturl = u'https://git.openstack.org/cgit/openstack/openstack-doc-tools/tree/doc/source'
git_cmd = "/usr/bin/git log | head -n1 | cut -f2 -d' '"
gitsha = os.popen(git_cmd).read().strip('\n')
bug_tag = u'openstack-doc-tools'
html_context = {"gitsha": gitsha, "bug_tag": bug_tag,
"giturl": giturl}
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
@ -62,6 +74,13 @@ html_theme_path = [openstackdocstheme.get_html_theme_path()]
# html_static_path = ['static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# 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'
# Output file base name for HTML help builder.
htmlhelp_basename = '%sdoc' % project

View File

@ -47,7 +47,7 @@ commands = python setup.py build_sphinx
[flake8]
show-source = True
builtins = _
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build,*autogenerate_config_docs/venv,*autogenerate_config_docs/sources
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build,*autogenerate_config_docs/venv,*autogenerate_config_docs/sources,doc/source/conf.py
# 28 is currently the most complex thing we have
max-complexity=29
ignore = H101