From 9a14370266ea27c7a560a142a6cf4624176ca6f9 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Mon, 16 Dec 2013 20:35:59 +0100 Subject: [PATCH] Add a wadl target to the documentation Thanks to sphinxcontrib-docbookrestapi, the documentation for the REST API can be automatically generated. Add a target to do this. Change-Id: I9dda41bc00160bf1be1e275d9ac94a3a53571688 --- doc/Makefile | 6 ++++++ doc/source/conf.py | 1 + doc/source/webapi/v2.rst | 2 ++ test-requirements.txt | 1 + 4 files changed, 10 insertions(+) diff --git a/doc/Makefile b/doc/Makefile index 385a11ec1..54a1a50d4 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -37,6 +37,7 @@ help: @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " wadl to build a WADL file for api.openstack.org" clean: -rm -rf $(BUILDDIR)/* @@ -50,6 +51,11 @@ html: check-dependencies check-dependencies: @python -c 'import sphinxcontrib.autohttp.flask' >/dev/null 2>&1 || (echo "ERROR: Missing Sphinx dependencies. Run: pip install sphinxcontrib-httpdomain" && exit 1) +wadl: + $(SPHINXBUILD) -b docbook $(ALLSPHINXOPTS) $(BUILDDIR)/wadl + @echo + @echo "Build finished. The WADL pages are in $(BUILDDIR)/wadl." + dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo diff --git a/doc/source/conf.py b/doc/source/conf.py index 98646df2d..8dc2d75e0 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -151,6 +151,7 @@ extensions = [ 'sphinx.ext.viewcode', 'sphinxcontrib.pecanwsme.rest', 'oslo.sphinx', + 'sphinxcontrib.docbookrestapi.setup' ] wsme_protocols = ['restjson', 'restxml'] diff --git a/doc/source/webapi/v2.rst b/doc/source/webapi/v2.rst index c2cbeb1b9..8e8aa3277 100644 --- a/doc/source/webapi/v2.rst +++ b/doc/source/webapi/v2.rst @@ -1,3 +1,5 @@ +.. docbookrestapi + ============ V2 Web API ============ diff --git a/test-requirements.txt b/test-requirements.txt index c2f050576..ec2c6ac91 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -16,6 +16,7 @@ docutils==0.9.1 oslo.sphinx python-subunit sphinx>=1.1.2,<1.2 +sphinxcontrib-docbookrestapi sphinxcontrib-httpdomain sphinxcontrib-pecanwsme>=0.5 testrepository>=0.0.17