Use the new html_context of openstackdocstheme

The new way of configuring html_context was introduced
in openstackdocstheme 1.11.0.
It is much simpler and most projects adopt it now.

Note that the current openstackdocstheme does not declare if it is
safe for parallel reading, so -j 2 or larget int does not work.
Let's drop -j option as the doc build is fast enough.

Change-Id: If1918b0101abf93aa55d4abe3c91a13bb0fe83d1
This commit is contained in:
Akihiro Motoki 2017-07-01 06:44:19 +00:00
parent c50a3199db
commit 7b5ad84ca8
2 changed files with 8 additions and 32 deletions

View File

@ -20,11 +20,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
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
# documentation root, use os.path.abspath to make it absolute, like shown here.
@ -38,8 +33,12 @@ import openstackdocstheme
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
extensions = ['openstackdocstheme']
# openstackdocstheme options
repository_name = 'openstack/i18n'
bug_project = 'openstack-i18n'
bug_tag = 'doc'
# Add any paths that contain templates here, relative to this directory.
# templates_path = ['_templates']
@ -68,22 +67,6 @@ version = '1.0.0'
# The full version, including alpha/beta/rc tags.
release = '1.0.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.
# These variables are passed to the logabug code via html_context.
giturl = u'https://git.openstack.org/cgit/openstack/i18n/tree/doc/source'
git_cmd = "/usr/bin/git rev-parse HEAD"
gitsha = os.popen(git_cmd).read().strip()
html_context = {
"bug_project": 'openstack-i18n',
"bug_tag": u'i18n-contributor-guide',
"gitsha": gitsha,
"giturl": giturl,
}
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
@ -139,7 +122,6 @@ html_theme = 'openstackdocs'
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = ['_theme']
html_theme_path = [openstackdocstheme.get_html_theme_path()]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".

View File

@ -20,14 +20,8 @@ set -e
DOCNAME=doc
DIRECTORY=doc
if [ -x "$(command -v getconf)" ]; then
NUMBER_OF_CORES=$(getconf _NPROCESSORS_ONLN)
else
NUMBER_OF_CORES=2
fi
# build i18n contributor guide page index.html
sphinx-build -a -W -j $NUMBER_OF_CORES -b html \
sphinx-build -a -W -b html \
-d ${DIRECTORY}/build/doctrees \
${DIRECTORY}/source ${DIRECTORY}/build/html/
@ -35,7 +29,7 @@ if [ "${NO_LANG_BUILD:-0}" = "1" ]; then
exit 0
fi
sphinx-build -a -W -j $NUMBER_OF_CORES -b gettext \
sphinx-build -a -W -b gettext \
-d ${DIRECTORY}/build/doctrees.gettext \
${DIRECTORY}/source ${DIRECTORY}/source/locale/
@ -69,7 +63,7 @@ for locale in `find ${DIRECTORY}/source/locale/ -maxdepth 1 -type d` ; do
# build translated guide
# build i18n contributor guide page index.html
# TODO(amotoki): Enable -W option in translated version
sphinx-build -a -j $NUMBER_OF_CORES -b html -D language=${language} \
sphinx-build -a -b html -D language=${language} \
-d ${DIRECTORY}/build/doctrees.languages/${language} \
${DIRECTORY}/source ${DIRECTORY}/build/html/${language}