Sphinx theme for RST-sourced documentation published to docs.openstack.org
Go to file
Brian Moss 52b3cd4907 Update Launchpad info
Tools and theme bugs are now being tracked in
the openstack-doc-tools project on Launchpad.

Change-Id: Ib8bcaab16a56ded4b286214ed5d5cddcdcd2263e
2017-02-17 10:26:28 +10:00
api-ref/source Use https instead of http for git.openstack.org 2017-02-09 00:17:37 +00:00
doc/source Use https instead of http for git.openstack.org 2017-02-09 00:17:37 +00:00
openstackdocstheme Merge "Remove duplicate search field from the left sidebar" 2017-02-10 13:55:47 +00:00
releasenotes Includes checklist when filing a bug for osmanuals 2017-01-19 16:45:44 -06:00
tools Add Constraints support 2016-12-21 12:01:20 +11:00
.gitignore API References dropdown menu 2016-08-22 10:27:45 -05:00
.gitreview add a .gitreview file 2015-02-03 12:28:09 -05:00
bindep.txt Install required packages 2016-09-01 20:56:42 +02:00
CONTRIBUTING.rst Update Launchpad info 2017-02-17 10:26:28 +10:00
HACKING.rst Update Launchpad info 2017-02-17 10:26:28 +10:00
index.rst Update Launchpad info 2017-02-17 10:26:28 +10:00
LICENSE Starting point for Sphinx theme for docs.openstack.org content 2015-01-20 10:49:21 -06:00
Makefile Starting point for Sphinx theme for docs.openstack.org content 2015-01-20 10:49:21 -06:00
README.rst Update Launchpad info 2017-02-17 10:26:28 +10:00
requirements.txt Updated from global requirements 2016-11-09 04:22:11 +00:00
setup.cfg Add trove classifiers for Python 2017-01-07 16:31:19 +01:00
setup.py Updated from global requirements 2015-12-23 00:36:03 +00:00
test-requirements.txt Updated from global requirements 2017-02-10 05:57:00 +00:00
tox.ini Add Constraints support 2016-12-21 12:01:20 +11:00

Team and repository tags

image

OpenStack docs.openstack.org Sphinx Theme

Theme and extension support for Sphinx documentation that is published to docs.openstack.org and developer.openstack.org.

Intended for use by OpenStack projects governed by the Technical Committee.

Using the Theme

Prior to using this theme, ensure your project can use the OpenStack brand by referring to the brand guidelines at https://www.openstack.org/brand.

Update the requirements list for your project to include openstackdocstheme (usually in test-requirements.txt).

If your project previously used the oslosphinx theme (without modifying the header navigation), remove oslosphinx from your requirements list, and then in your conf.py you can remove the import statement and 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:

import openstackdocstheme

html_theme = 'openstackdocs'
html_theme_path = [openstackdocstheme.get_html_theme_path()]

Also, you must include these variables so that the "Log a bug" link sends metadata for the project where the docs reside. You'll also need to add import subprocess to the top of your conf.py file:

# We ask git for the SHA checksum
# The git SHA checksum is used by "log-a-bug"
git_cmd = ["/usr/bin/git", "rev-parse", "HEAD"]
gitsha = subprocess.Popen(
    git_cmd, stdout=subprocess.PIPE).communicate()[0].strip('\n')
# tag that reported bugs will be tagged with
bug_tag = "your-chosen-tag"
# source tree
pwd = os.getcwd()
# 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'

Note

If you're using Python 3 to build, you'll need to adjust the gitsha command to add a .decode('utf-8') option.

gitsha = subprocess.Popen(
    git_cmd, stdout=subprocess.PIPE).communicate()[0].decode('utf-8').strip('\n')