From 2a4628f18840ed7f01f3cd5c352d47a33b32d87c Mon Sep 17 00:00:00 2001 From: Hagen Wierstorf Date: Wed, 10 Jan 2024 09:28:14 +0100 Subject: [PATCH] Fix usage documentation by excluding autosummary --- docs/api-src/audb.rst | 2 ++ docs/usage.rst | 35 +++++++++-------------------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/docs/api-src/audb.rst b/docs/api-src/audb.rst index db1e7e5..f1a6af4 100644 --- a/docs/api-src/audb.rst +++ b/docs/api-src/audb.rst @@ -1,3 +1,5 @@ +.. _audb: + audb ==== diff --git a/docs/usage.rst b/docs/usage.rst index fb1b09a..b9af1c7 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -23,36 +23,19 @@ added by ``sphinx_apipages``. For each (sub-)module you would like to generate API documentation, add a file with the name of the module -to ``docs/api-src`` +to ``docs/api-src/`` and list the functions/classes -to include with ``autosummary``. -E.g. assume your Python module is named ``foo``, -and contains the class ``foo.Bar`` -and the function ``foo.bar``. -Then you would create ``docs/api-src/foo.rst`` -containing: - -.. code-block:: rst - - foo - === - - .. automodule:: foo - - .. autosummary:: - :toctree: - :nosignatures: - - Bar - bar +to include with ``autosummary``, +compare :ref:`API documentation example with audb `. When building the documentation, -``sphinx_apipages`` will generate RST files +``sphinx_apipages`` will copy all files +from ``docs/api-src/`` +to ``docs/api/``, +and generate RST files for each class and function, -and store them under ``docs/api``. -For the example above it will generate -``docs/api/foo.Bar.rst`` -and ``docs/api/foo.bar.rst``. +and store them under ``docs/api/`` +as well. Configuration