From aaa7983b2f2ce6302c43a3c48a2341b2a7d0a3a5 Mon Sep 17 00:00:00 2001
From: Martin Teichmann <martin.teichmann@xfel.eu>
Date: Mon, 8 Feb 2021 16:19:17 +0000
Subject: [PATCH] add autodocs for modules

---
 .gitlab-ci.yml       |  1 +
 ebpfcat/devices.py   | 18 ++++++++++++++++++
 ebpfcat/ethercat.rst |  7 +++++++
 3 files changed, 26 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f09ebb0..8c0d36b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,7 @@ test:
 docs:
     image: tk0miya/sphinx-html
     script:
+        - python3 setup.py install --user
         - sphinx-build -b html -d _build/doctrees . _build/html
         - eval $(ssh-agent)
         - echo "$SSHKEY" | ssh-add -
diff --git a/ebpfcat/devices.py b/ebpfcat/devices.py
index 529676b..724004e 100644
--- a/ebpfcat/devices.py
+++ b/ebpfcat/devices.py
@@ -1,7 +1,20 @@
+"""\
+A collection of devices
+=======================
+
+This modules contains a collection of devices which may be helpful
+in many projects.
+"""
 from .ebpfcat import Device, FastSyncGroup, TerminalVar, DeviceVar
 
 
 class AnalogInput(Device):
+    """Generic analog input device
+
+    This device can be linked to an analog input of a terminal.
+    It will read from there and return the result in its
+    parameter `value`.
+    """
     value = DeviceVar()
     data = TerminalVar()
 
@@ -16,6 +29,11 @@ class AnalogInput(Device):
 
 
 class AnalogOutput(Device):
+    """Generic analog output device
+
+    This device can be linked to an analog output of a terminal.
+    It will write the `value` to that terminal.
+    """
     value = DeviceVar()
     data = TerminalVar()
 
diff --git a/ebpfcat/ethercat.rst b/ebpfcat/ethercat.rst
index c6c78bd..1b04119 100644
--- a/ebpfcat/ethercat.rst
+++ b/ebpfcat/ethercat.rst
@@ -92,3 +92,10 @@ The communication with the terminals can happen in three different ways:
 - fast: the data is sent, received and processed using XDP in the Linux
   Kernel. Only very limited operations can be done, but the loop cycle
   frequency exceeds 10 kHz.
+
+
+.. automodule:: ebpfcat.devices
+   :members:
+
+.. automodule:: ebpfcat.ethercat
+   :members:
-- 
GitLab