From 058e4e2485cb1cec765e32c7af73dc13c6b66f14 Mon Sep 17 00:00:00 2001 From: Simon Pomarede Date: Tue, 2 Feb 2016 14:11:49 +0100 Subject: [PATCH] SPO - Modifications to enable auto documentation of Python code --- doc/Makefile | 5 ++++- doc/source/conf.py | 7 +++++-- doc/source/index.rst | 10 ++++++++++ src/__init__.py | 0 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 src/__init__.py diff --git a/doc/Makefile b/doc/Makefile index 70c2696..f79ee77 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -37,7 +37,7 @@ help: clean: -rm -rf $(BUILDDIR)/* -html: +html: apidoc $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." @@ -137,3 +137,6 @@ doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." + +apidoc: + @sphinx-apidoc -o source/commands/apidoc ../src diff --git a/doc/source/conf.py b/doc/source/conf.py index f85e513..39d1117 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -26,7 +26,7 @@ import os # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [] +extensions = ['sphinx.ext.autodoc'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -117,7 +117,7 @@ html_theme = 'default' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -html_favicon = "images/salomeTools.ico" +#html_favicon = "images/salomeTools.ico" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -216,3 +216,6 @@ man_pages = [ ('index', 'salometools', u'salomeTools Documentation', [u'CEA'], 1) ] + +# Append source folder to path in order to enable autodoc +sys.path.append(os.path.join('..')) \ No newline at end of file diff --git a/doc/source/index.rst b/doc/source/index.rst index 6aa94fe..30b3450 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -28,6 +28,16 @@ List of Commands config +Code documentation +================== + +.. toctree:: + :maxdepth: 1 + + SAT modules + + + Release Notes ============= Here are the release notes for sat: diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 -- 2.39.2