docs: added auto-generation of documentation

ref: N25B-270
This commit is contained in:
Storm
2025-11-19 13:49:50 +01:00
parent b05aa5e834
commit 9dd39d2048
3 changed files with 31 additions and 1 deletions

View File

@@ -146,3 +146,25 @@ If your commit fails its either:
branch name != <type>/description-of-branch ,
commit name != <type>: description of the commit.
<ref>: N25B-Num's
## Documentation
Generate documentation web pages using:
```bash
PYTHONPATH=src sphinx-apidoc -F -o docs src/robot_interface
```
Optionally, in the `conf.py` file in the new `docs` folder, change preferences.
For the page theme, change `html_theme` to `'sphinx_rtd_theme'`.
In the `docs` folder:
### Windows
```bash
.\make.bat html
```
### MacOS
```bash
make html
```

View File

@@ -3,3 +3,5 @@ pyaudio<=0.2.11
pytest<5
pytest-mock<3.0.0
pytest-cov<3.0.0
sphinx
sphinx_rtd_theme

View File

@@ -45,7 +45,13 @@ class State(object):
def __getattribute__(self, name):
# Enforce that the state is initialized before accessing any property (aside from the basic ones)
if name in ("initialize", "deinitialize", "is_initialized", "__dict__", "__class__"):
if name in (
"initialize",
"deinitialize",
"is_initialized",
"__dict__",
"__class__",
"__doc__"):
return object.__getattribute__(self, name)
if not object.__getattribute__(self, "is_initialized"):