Skip to content

Commit 6dc1286

Browse files
author
Steve Martinelli
committed
Enhance the theming for modules page
Also fixes a few small docstring syntax errors Change-Id: I85eb968e32c1191cf5d60d02deff2ab7f3291074
1 parent 3b1c308 commit 6dc1286

7 files changed

Lines changed: 56 additions & 4 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ AUTHORS
1515
build
1616
ChangeLog
1717
dist
18+
# Doc related
1819
doc/build
20+
doc/source/api/
1921
# Development environment files
2022
.project
2123
.pydevproject

doc/ext/__init__.py

Whitespace-only changes.

doc/ext/apidoc.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright 2014 OpenStack Foundation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4+
# not use this file except in compliance with the License. You may obtain
5+
# a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations
13+
# under the License.
14+
15+
import os.path as path
16+
17+
from sphinx import apidoc
18+
19+
20+
# NOTE(blk-u): pbr will run Sphinx multiple times when it generates
21+
# documentation. Once for each builder. To run this extension we use the
22+
# 'builder-inited' hook that fires at the beginning of a Sphinx build.
23+
# We use ``run_already`` to make sure apidocs are only generated once
24+
# even if Sphinx is run multiple times.
25+
run_already = False
26+
27+
28+
def run_apidoc(app):
29+
global run_already
30+
if run_already:
31+
return
32+
run_already = True
33+
34+
package_dir = path.abspath(path.join(app.srcdir, '..', '..',
35+
'openstackclient'))
36+
source_dir = path.join(app.srcdir, 'api')
37+
apidoc.main(['apidoc', package_dir, '-f',
38+
'-H', 'openstackclient Modules',
39+
'-o', source_dir])
40+
41+
42+
def setup(app):
43+
app.connect('builder-inited', run_apidoc)

doc/source/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
# documentation root, use os.path.abspath to make it absolute, like shown here.
2323
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
2424

25+
# NOTE(blk-u): Path for our Sphinx extension, remove when
26+
# https://launchpad.net/bugs/1260495 is fixed.
27+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
28+
2529
# -- General configuration ----------------------------------------------------
2630

2731
# If your documentation needs a minimal Sphinx version, state it here.
@@ -32,7 +36,9 @@
3236
extensions = ['sphinx.ext.autodoc',
3337
'sphinx.ext.doctest',
3438
'sphinx.ext.todo',
35-
'oslosphinx']
39+
'oslosphinx',
40+
'ext.apidoc',
41+
]
3642

3743
# Add any paths that contain templates here, relative to this directory.
3844
#templates_path = ['_templates']

doc/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ the openstack/python-openstackclient project using `Gerrit`_.
3737
.. _Launchpad: https://launchpad.net/python-openstackclient
3838
.. _Gerrit: http://wiki.openstack.org/GerritWorkflow
3939

40-
Index
41-
=====
40+
Indices and Tables
41+
==================
4242

4343
* :ref:`genindex`
4444
* :ref:`modindex`

openstackclient/api/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ def find_attr(
227227
attribute to use for resource search
228228
:param string resource:
229229
plural of the object resource name; defaults to path
230+
230231
For example:
231232
n = find(netclient, 'network', 'networks', 'matrix')
232233
"""

openstackclient/common/commandmanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CommandManager(cliff.commandmanager.CommandManager):
2828
"""Add additional functionality to cliff.CommandManager
2929
3030
Load additional command groups after initialization
31-
Add *_command_group() methods
31+
Add _command_group() methods
3232
"""
3333

3434
def __init__(self, namespace, convert_underscores=True):

0 commit comments

Comments
 (0)