Implement inventory API docs

The docstrings for public functions within dynamic_inventory.py are
passed through Sphinx and added to the inventory documentation page.

This change also corrects some of the syntax for the docstrings to fix
warnings and errors.

Change-Id: Ic461b5cff1351111ce3221093f1d6627d2b10aab
This commit is contained in:
Nolan Brubaker
2016-08-11 18:17:30 -04:00
committed by Jesse Pretorius (odyssey4me)
parent 35fbce572d
commit f7babef5bb
3 changed files with 20 additions and 8 deletions

View File

@@ -26,10 +26,12 @@ import openstackdocstheme
import os
import pbr.version
from subprocess import Popen, PIPE
import sys
# 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.
# sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../../playbooks/inventory/'))
# -- General configuration ------------------------------------------------
@@ -40,7 +42,7 @@ from subprocess import Popen, PIPE
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
# TODO(ajaeger): enable PDF building, for example add 'rst2pdf.pdfbuilder'
extensions = []
extensions = ['sphinx.ext.autodoc']
# Add any paths that contain templates here, relative to this directory.
#templates_path = ['_templates']

View File

@@ -142,6 +142,12 @@ Use the host's name as an argument.
.. _`dynamic inventory functionality`: http://docs.ansible.com/ansible/intro_dynamic_inventory.html
Dynamic Inventory API documentation
-----------------------------------
.. automodule:: dynamic_inventory
:members:
--------------
.. include:: navigation.txt