doc: update the configuration of the theme

Use the configuration options described in the documentation of
openstackdocstheme and clean up some old options on the way.

Change-Id: I16972c7fa1102baf66bd4478e03c0f6c77096788
This commit is contained in:
Luigi Toscano 2017-07-03 22:40:55 +02:00
parent 506f85b790
commit 541edfc8ef
3 changed files with 24 additions and 63 deletions

View File

@ -25,19 +25,22 @@
# serve to show the default.
import os
import subprocess
import sys
import warnings
import openstackdocstheme
extensions = [
'os_api_ref',
'openstackdocstheme'
]
# openstackdocstheme options
repository_name = 'openstack/sahara'
bug_project = 'sahara'
bug_tag = 'api-ref'
html_last_updated_fmt = '%Y-%m-%d %H:%M'
html_theme = 'openstackdocs'
html_theme_path = [openstackdocstheme.get_html_theme_path()]
html_theme_options = {
"sidebar_dropdown": "api_ref",
"sidebar_mode": "toc",
}
@ -64,17 +67,9 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'Compute API Reference'
project = u'Data Processing API Reference'
copyright = u'2010-present, OpenStack Foundation'
# Config logABug feature
giturl = u'http://git.openstack.org/cgit/openstack/sahara/tree/api-ref/source'
# source tree
# html_context allows us to pass arbitrary values into the html template
html_context = {"bug_tag": "api-ref",
"giturl": giturl,
"bug_project": "sahara"}
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
@ -156,17 +151,6 @@ pygments_style = 'sphinx'
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
# 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.
# html_use_smartypants = True
@ -214,7 +198,7 @@ htmlhelp_basename = 'saharaoc'
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
('index', 'Sahara.tex', u'OpenStack Compute API Documentation',
('index', 'Sahara.tex', u'OpenStack Data Processing API Documentation',
u'OpenStack Foundation', 'manual'),
]

View File

@ -20,8 +20,6 @@ import subprocess
import sys
import warnings
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.
@ -40,7 +38,13 @@ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage',
'sphinx.ext.viewcode', 'sphinxcontrib.httpdomain']
'sphinx.ext.viewcode', 'sphinxcontrib.httpdomain', 'openstackdocstheme']
# openstackdocstheme options
repository_name = 'openstack/sahara'
bug_project = 'sahara'
bug_tag = 'doc'
html_last_updated_fmt = '%Y-%m-%d %H:%M'
config_generator_config_file = 'config-generator.conf'
config_sample_basename = 'sahara'
@ -116,7 +120,6 @@ if on_rtd:
html_theme = '_theme_rtd'
html_theme = 'openstackdocs'
html_theme_path = [openstackdocstheme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@ -147,25 +150,6 @@ html_title = 'Sahara'
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# 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".')
giturl = u'http://git.openstack.org/cgit/openstack/sahara/tree/doc/source'
# html_context allows us to pass arbitrary values into the html template
html_context = {
"bug_tag": "doc",
"giturl": giturl,
"bug_project": "sahara"
}
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

View File

@ -14,13 +14,17 @@
# Sahara Release Notes documentation build configuration file
import openstackdocstheme
extensions = [
'reno.sphinxext',
'openstackdocstheme'
]
# openstackdocstheme options
repository_name = 'openstack/sahara'
bug_project = 'sahara'
bug_tag = 'releasenotes'
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@ -58,7 +62,6 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'openstackdocs'
html_theme_path = [openstackdocstheme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@ -89,16 +92,6 @@ html_theme_path = [openstackdocstheme.get_html_theme_path()]
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
giturl = (
u'http://git.openstack.org/cgit/openstack/sahara/tree/releasenotes/source'
)
# html_context allows us to pass arbitrary values into the html template
html_context = {
"bug_tag": "releasenotes",
"giturl": giturl,
"bug_project": "sahara"
}
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.