From a22aef3e7a792dde016fa7dc92d7106b86cb65e4 Mon Sep 17 00:00:00 2001 From: Lance Bragstad Date: Mon, 17 Sep 2018 15:17:51 +0000 Subject: [PATCH] Render API reference documentation Now that we're starting to commit code to the repository and build out an API, we should start generating documentation for it. Change-Id: I20e9d3155331c08cc3817c17c183e80a89235b7f --- doc/requirements.txt | 1 + doc/source/conf.py | 8 +++++++- doc/source/reference/index.rst | 9 ++------- setup.cfg | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index f5351e1..60996ea 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -4,3 +4,4 @@ openstackdocstheme>=1.20.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD +sphinxcontrib-apidoc>=0.2.0 # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index 70418cc..88f00f1 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -18,9 +18,15 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ - 'openstackdocstheme' + 'openstackdocstheme', + 'sphinxcontrib.apidoc' ] +apidoc_module_dir = '../../oslo_limit' +apidoc_excluded_paths = ['tests'] +apidoc_output_dir = 'reference/api' +apidoc_separate_modules = True + # The suffix of source filenames. # source_suffix = '.rst' diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index 625cd36..e1b1cc9 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -2,11 +2,6 @@ oslo.limit API Reference ======================== -.. Use autodoc directives to describe the *public* modules and classes - in the library. +.. toctree:: - If the modules are completely unrelated, create an api subdirectory - and use a separate file for each (see oslo.utils). - - If there is only one submodule, a single api.rst file like this - sufficient (see oslo.i18n). + api/modules diff --git a/setup.cfg b/setup.cfg index ebe66b7..984cdda 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,4 +41,4 @@ mapping_file = babel.cfg output_file = oslo_limit/locale/oslo_limit.pot [wheel] -universal = true \ No newline at end of file +universal = true