Browse Source

Merge "Update OpenStack documentation template"

Jenkins 2 years ago
parent
commit
3c9ddf506e
2 changed files with 28 additions and 8 deletions
  1. 1
    1
      bindep.txt
  2. 27
    7
      doc/source/conf.py

+ 1
- 1
bindep.txt View File

@@ -30,7 +30,7 @@ python-devel [platform:rpm]
30 30
 python-libvirt [platform:dpkg]
31 31
 python-lxml
32 32
 python-sphinx [platform:dpkg]
33
-python-oslosphinx [platform:dpkg]
33
+python-openstackdocstheme [platform:dpkg]
34 34
 python3-all-dev [platform:ubuntu-trusty]
35 35
 python3-dev [platform:dpkg]
36 36
 python3-devel [platform:fedora]

+ 27
- 7
doc/source/conf.py View File

@@ -16,14 +16,15 @@ import datetime
16 16
 import os
17 17
 import sys
18 18
 
19
+import openstackdocstheme
20
+
19 21
 sys.path.insert(0, os.path.abspath('../..'))
20 22
 # -- General configuration ----------------------------------------------------
21 23
 
22 24
 # Add any Sphinx extension module names here, as strings. They can be
23 25
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
24 26
 extensions = [
25
-    'sphinx.ext.autodoc',
26
-    'oslosphinx'
27
+    'sphinx.ext.autodoc'
27 28
 ]
28 29
 
29 30
 exclude_patterns = [
@@ -52,6 +53,24 @@ master_doc = 'index'
52 53
 project = u'js-openstack-lib'
53 54
 copyright = u'%s, OpenStack Foundation' % datetime.date.today().year
54 55
 
56
+# A few variables have to be set for the log-a-bug feature.
57
+#   giturl: The location of conf.py on Git. Must be set manually.
58
+#   gitsha: The SHA checksum of the bug description. Extracted from git log.
59
+#   bug_tag: Tag for categorizing the bug. Must be set manually.
60
+#   bug_project: Launchpad project to file bugs against.
61
+# These variables are passed to the logabug code via html_context.
62
+giturl = u'http://git.openstack.org/cgit/openstack/js-openstack-lib/tree/doc/source'
63
+git_cmd = "/usr/bin/git log | head -n1 | cut -f2 -d' '"
64
+gitsha = os.popen(git_cmd).read().strip('\n')
65
+bug_tag = "docs"
66
+# source tree
67
+pwd = os.getcwd()
68
+# html_context allows us to pass arbitrary values into the html template
69
+html_context = {"pwd": pwd,
70
+                "gitsha": gitsha,
71
+                "bug_tag": bug_tag,
72
+                "giturl": giturl}
73
+
55 74
 # If true, '()' will be appended to :func: etc. cross-reference text.
56 75
 add_function_parentheses = True
57 76
 
@@ -64,11 +83,12 @@ pygments_style = 'sphinx'
64 83
 
65 84
 # -- Options for HTML output --------------------------------------------------
66 85
 
67
-# The theme to use for HTML and HTML Help pages.  Major themes that come with
68
-# Sphinx are currently 'default' and 'sphinxdoc'.
69
-# html_theme_path = ["."]
70
-# html_theme = '_theme'
71
-# html_static_path = ['static']
86
+# The theme to use for HTML and HTML Help pages.  See the documentation for
87
+# a list of builtin themes.
88
+html_theme = 'openstackdocs'
89
+
90
+# Add any paths that contain custom themes here, relative to this directory.
91
+html_theme_path = [openstackdocstheme.get_html_theme_path()]
72 92
 
73 93
 # Output file base name for HTML help builder.
74 94
 htmlhelp_basename = '%sdoc' % project

Loading…
Cancel
Save