Theme needs a setup function to be used from package

Change-Id: I2212941f09b00f5c0cbc29217fe59cfa408367a0
This commit is contained in:
Anne Gentle 2015-02-02 16:11:29 -06:00
parent 63ed912e10
commit 3e05dffc7b
4 changed files with 41 additions and 11 deletions

View File

@ -124,7 +124,7 @@ Import a key pair
#. To change its permissions so that only you can read and write to the
file, run the following command:
.. code::
.. code:: bash
$ chmod 0600 yourPrivateKey.pem
@ -135,7 +135,7 @@ Import a key pair
#. To make the key pair known to SSH, run the **ssh-add** command.
.. code::
.. code:: bash
$ ssh-add yourPrivateKey.pem

View File

@ -24,7 +24,7 @@ flavor for the type of database instance you want.
#. Add the following line to ``/etc/trove/trove.conf``:
.. code::
.. code:: ini
default_datastore = DATASTORE_NAME
@ -36,13 +36,13 @@ flavor for the type of database instance you want.
For example, if your MySQL datastore name is set to ``mysql``,
your entry would look like this:
.. code::
.. code:: ini
default_datastore = mysql
#. Restart Database services on the controller node:
.. code::
.. code:: bash
# service trove-api restart
# service trove-taskmanager restart

View File

@ -1,8 +1,4 @@
.. os-doc-demo documentation master file, created by
sphinx-quickstart on Tue Jan 20 08:22:27 2015.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
==================
Demo documentation
==================
@ -21,6 +17,18 @@ Here's an example configuration::
vncserver_proxyclient_address = 10.0.0.31
novncproxy_base_url = http://controller:6080/vnc_auto.html
Here's the same example but with ..code: ini to test the pygments lexer:
.. code:: ini
[DEFAULT]
...
my_ip = 10.0.0.31
vnc_enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = 10.0.0.31
novncproxy_base_url = http://controller:6080/vnc_auto.html
.. note:: Here's an example note.
.. toctree::

View File

@ -15,7 +15,29 @@
import os
def builder_inited(app):
theme_dir = os.path.join(os.path.dirname(__file__), 'theme')
app.info('Using openstackdocstheme Sphinx theme from %s' % theme_dir)
# Insert our theme directory at the front of the search path and
# force the theme setting to use the one in the package. This is
# done here, instead of in setup(), because conf.py is read after
# setup() runs, so if the conf contains these values the user
# values overwrite these. That's not bad for the theme, but it
# breaks the search path.
app.config.html_theme_path.insert(0, theme_dir)
# Set the theme name
app.config.html_theme = 'openstackdocstheme'
# Re-initialize the builder, if it has the method for setting up
# the templates and theme.
if hasattr(app.builder, 'init_templates'):
app.builder.init_templates()
def get_html_theme_path():
"""Return the directory containing our HTML theme."""
"""Return the directory containing HTML theme for local builds."""
pkg_dir = os.path.abspath(os.path.dirname(__file__))
return os.path.join(pkg_dir, 'theme')
def setup(app):
app.connect('builder-inited', builder_inited)