From ad3defffe32ecc7bfb3ae03dda190bb95f37d323 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 27 Apr 2019 17:19:51 +1000 Subject: [PATCH] Use sphinx-autoapi to generate documentation files - Select which files to ignore - Only display items with a docstring --- docs/conf.py | 22 ++++++++++++++++------ docs/requirements.txt | 3 ++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 29db84e819..78bcb74673 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,14 +28,24 @@ copyright = '2019, InvenTree' # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.coverage', - 'sphinx.ext.napoleon', - 'sphinx.ext.viewcode', + 'autoapi.extension' ] -napoleon_google_docstring = False -napoleon_use_param = False -napoleon_use_ivar = True +autoapi_dirs = [ + '../InvenTree', +] + +autoapi_options = [ + 'members', +] + +autoapi_type = 'python' + +autoapi_ignore = [ + '*migrations*', + '**/test*.py', + '**/manage.py' +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/requirements.txt b/docs/requirements.txt index 0a7db8d3a4..7f9639c4b0 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ Sphinx>=2.0.1 -sphinx_rtd_theme==0.4.3 \ No newline at end of file +sphinx-auto-api==1.0.0 +sphinx-rtd-theme==0.4.3 \ No newline at end of file