Merge "use openstackdocstheme html context"
This commit is contained in:
commit
95b1e3cf41
@ -26,11 +26,8 @@ from __future__ import print_function
|
||||
|
||||
import django
|
||||
import logging
|
||||
import openstackdocstheme
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
|
||||
# NOTE(amotoki): Sphinx 1.6.x catches warnings from imported modules.
|
||||
@ -69,8 +66,15 @@ extensions = ['sphinx.ext.autodoc',
|
||||
'sphinx.ext.todo',
|
||||
'sphinx.ext.coverage',
|
||||
'sphinx.ext.viewcode',
|
||||
'openstackdocstheme',
|
||||
]
|
||||
|
||||
# openstackdocstheme options
|
||||
repository_name = 'openstack/horizon'
|
||||
bug_project = 'horizon'
|
||||
bug_tag = 'documentation'
|
||||
html_last_updated_fmt = '%Y-%m-%d %H:%M'
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
@ -150,7 +154,7 @@ html_theme_options = {
|
||||
}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
html_theme_path = [openstackdocstheme.get_html_theme_path()]
|
||||
# html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
@ -176,13 +180,6 @@ html_static_path = []
|
||||
# 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'
|
||||
git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
|
||||
"-n1"]
|
||||
try:
|
||||
html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8')
|
||||
except Exception:
|
||||
warnings.warn('Cannot get last updated time from git repository. '
|
||||
'Not setting "html_last_updated_fmt".')
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
@ -224,20 +221,6 @@ except Exception:
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'Horizondoc'
|
||||
|
||||
# We ask git for the SHA checksum
|
||||
# The git SHA checksum is used by "log-a-bug"
|
||||
gitsha = subprocess.check_output(git_cmd).strip('\n')
|
||||
giturl = u'https://git.openstack.org/cgit/openstack/horizon/tree/doc/source'
|
||||
# html_context allows us to pass arbitrary values into the html template
|
||||
html_context = {
|
||||
"gitsha": gitsha,
|
||||
"giturl": giturl,
|
||||
"bug_project": "horizon",
|
||||
# tag that reported bugs will be tagged with
|
||||
"bug_tag": "documentation",
|
||||
}
|
||||
|
||||
|
||||
# -- Options for LaTeX output -------------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
|
@ -29,8 +29,6 @@
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
import openstackdocstheme
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
@ -42,8 +40,15 @@ import openstackdocstheme
|
||||
extensions = [
|
||||
'reno.sphinxext',
|
||||
'sphinx.ext.extlinks',
|
||||
'openstackdocstheme',
|
||||
]
|
||||
|
||||
# openstackdocstheme options
|
||||
repository_name = 'openstack/horizon'
|
||||
bug_project = 'horizon'
|
||||
bug_tag = 'documentation'
|
||||
html_last_updated_fmt = '%Y-%m-%d %H:%M'
|
||||
|
||||
# Set aliases for extlinks
|
||||
# - generic launchpad bug - [:bug:`12345`]
|
||||
# - horizon blueprint - [:blueprint:`drop-nova-network`]
|
||||
@ -138,7 +143,6 @@ html_theme = 'openstackdocs'
|
||||
|
||||
# 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
|
||||
# "<project> v<release> documentation".
|
||||
|
Loading…
Reference in New Issue
Block a user