From f1a8496189b2ef12a3037530faf7742cde4e78fd Mon Sep 17 00:00:00 2001
From: Karel van Klink <karel.vanklink@geant.org>
Date: Mon, 24 Apr 2023 16:45:33 +0200
Subject: [PATCH] Add docstrings to generated documentation

Ignores lso.app since it causes an error, and doesn't contain anything useful
---
 build-docs.sh         | 1 +
 docs/source/conf.py   | 2 +-
 docs/source/index.rst | 1 +
 lso/config.py         | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/build-docs.sh b/build-docs.sh
index 77d4994..523d06c 100755
--- a/build-docs.sh
+++ b/build-docs.sh
@@ -1,3 +1,4 @@
 python docs/dump-openapi-spec.py
 
+sphinx-apidoc lso lso/app.py -o docs/source -d 2 -f
 sphinx-build -b html docs/source docs/build
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 5623743..b499e94 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -19,7 +19,7 @@ import sys
 sys.path.insert(0, os.path.abspath(
     os.path.join(
         os.path.dirname(__file__),
-        '..', '..', 'resource_management')))
+        '..', '..', 'lso')))
 
 
 class RenderAsJSON(Directive):
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 74ff58e..85ec421 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -8,6 +8,7 @@ Documentation for LSO: a Lightweight Service Orchestrator
    :caption: Contents:
 
    quickstart
+   modules
 
 
 `Swagger API Docs <_static/openapi.html>`__
diff --git a/lso/config.py b/lso/config.py
index 2ad71a1..1cd2c02 100644
--- a/lso/config.py
+++ b/lso/config.py
@@ -40,7 +40,7 @@ def load_from_file(file):
 
     Input is validated against this jsonschema:
 
-    .. asjson:: resource_management.config.CONFIG_SCHEMA
+    .. asjson:: lso.config.CONFIG_SCHEMA
 
     :param file: file-like object that produces the config file
     :return: a dict containing the parsed configuration parameters
-- 
GitLab