Document conf.py variables

Adds information about conf.py variables that must be included for log-a-bug

Change-Id: I70fd2bb31d7eeb6a32f9df43ef6c729225169e37
This commit is contained in:
Anne Gentle 2015-04-17 10:11:46 -05:00 committed by Andreas Jaeger
parent 415893ae82
commit 119b88f13b

View File

@ -19,6 +19,10 @@ the header navigation), remove oslosphinx from your requirements list,
and then in your ``conf.py`` you can remove the import statement and and then in your ``conf.py`` you can remove the import statement and
extension listing for oslosphinx. extension listing for oslosphinx.
Some of the settings below are included in the file generated by Sphinx when
you initialize a project, so they may already have values that need to be
changed.
Then modify your Sphinx settings in ``conf.py`` to include:: Then modify your Sphinx settings in ``conf.py`` to include::
import openstackdocstheme import openstackdocstheme
@ -26,9 +30,19 @@ Then modify your Sphinx settings in ``conf.py`` to include::
html_theme = 'openstackdocs' html_theme = 'openstackdocs'
html_theme_path = [openstackdocstheme.get_html_theme_path()] html_theme_path = [openstackdocstheme.get_html_theme_path()]
Those settings are included in the file generated by Sphinx when you Also, you must include these variables so that the "Log a bug" link sends
initialize a project, so they may already have values that need to be metadata for the project where the docs reside::
changed.
# 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}
# Must set this variable to include year, month, day, hours, and minutes.
html_last_updated_fmt = '%Y-%m-%d %H:%M'
* Free software: Apache License, Version 2.0 * Free software: Apache License, Version 2.0
* Documentation: http://docs.openstack.org/developer/openstackdocstheme * Documentation: http://docs.openstack.org/developer/openstackdocstheme