From 152bf4fbddab2ee125e73e63d505916f677aa6f8 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Tue, 30 Oct 2018 14:32:51 +0100 Subject: [PATCH] [doc] start adding autodoc to sphinx documents --- doc/conf.py | 9 ++++++++- doc/index.rst | 1 + doc/python.rst | 27 +++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 doc/python.rst diff --git a/doc/conf.py b/doc/conf.py index 4b5a58fa..7d491b05 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -29,7 +29,14 @@ from this_version import get_aubio_version # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.viewcode', 'sphinx.ext.autodoc'] +extensions = ['sphinx.ext.viewcode', 'sphinx.ext.autodoc', + 'sphinx.ext.napoleon', 'sphinx.ext.intersphinx'] + +autodoc_member_order = 'groupwise' + +intersphinx_mapping = { + 'numpy': ('https://docs.scipy.org/doc/numpy/', None), + } # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/doc/index.rst b/doc/index.rst index 4fc80de8..5581f73b 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -70,6 +70,7 @@ Content installing python_module + python cli develop about diff --git a/doc/python.rst b/doc/python.rst new file mode 100644 index 00000000..89d607a7 --- /dev/null +++ b/doc/python.rst @@ -0,0 +1,27 @@ +.. make sure our default-domain is python here +.. default-domain:: py + +.. set current module +.. currentmodule:: aubio + +.. + we follow numpy type docstrings, see: + https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard + +Python documentation +==================== + + +.. midiconv.py + +.. autofunction:: note2midi + +.. autofunction:: midi2note + +.. autofunction:: freq2note + +.. autofunction:: note2freq + +.. slicing.py + +.. autofunction:: slice_source_at_stamps -- 2.11.0