diff --git a/README.md b/README.md index 6344e37..f465f68 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,37 @@ poetry install # Для проектов с использованием pip pip install -r requirements-dev.txt Теперь в вашем виртуальном окружении будут установлены Sphinx, Pylint и MyPy, которые рекомендуется использовать для разработки проекта. + + + +## Генерация документации + +#Документация создана с использованием Sphinx. Для ее перегенерации выполните следующие шаги: + +cd advanced-python-homework-2023 +mkdir doc +cd doc +sphinx-quickstart +cd .. +sphinx-apidoc -o doc . +cd doc +rm modules.rst +rm setup.rst + +#Отредактируйте файл docs/conf.py и добавьте следующий код: + +import os +import sys +sys.path.insert(0, os.path.abspath('../')) + +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.napoleon', # Для поддержки Google-style docstrings +] + + +#Выполните команду для генерации документации: + + cd .. + make html +#Open file:///home/timur/Gitea/advanced-python-homework-2023/doc/build/html/search.html THAT`s ALL FOR TODAY) diff --git a/controls/__init__.py b/controls/__init__.py index e69de29..493e129 100644 --- a/controls/__init__.py +++ b/controls/__init__.py @@ -0,0 +1,16 @@ +"""Controls Package + +This package implements the control logic for a SCADA (Supervisory Control and Data Acquisition) system. + +SCADA systems are used to monitor and control industrial processes. They provide the following capabilities: + +- Real-time Data Acquisition: Collect data from sensors and devices in real-time. +- Process Monitoring: Monitor and display the status of industrial processes. +- Remote Control: Allow remote operators to control industrial processes. +- Alarming: Raise alarms in case of abnormal conditions. +- Historical Data Logging: Record and store historical data for analysis. +- Human-Machine Interface (HMI): Provide a graphical interface for operators. + +This package is designed to encapsulate the control logic required for a SCADA system, providing a modular +and maintainable structure for implementing the various functionalities. +""" diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/controls.rst b/doc/controls.rst new file mode 100644 index 0000000..850c076 --- /dev/null +++ b/doc/controls.rst @@ -0,0 +1,21 @@ +controls package +================ + +Submodules +---------- + +controls.my\_module module +-------------------------- + +.. automodule:: controls.my_module + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: controls + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/make.bat b/doc/make.bat new file mode 100644 index 0000000..747ffb7 --- /dev/null +++ b/doc/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 0000000..9baab1e --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,35 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'Sphinx_project' +copyright = '2023, Temur' +author = 'Temur' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +import os +import sys +sys.path.insert(0, os.path.abspath('../')) + +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.napoleon', # Для поддержки Google-style docstrings +] + + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'alabaster' +html_static_path = ['_static'] diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 0000000..fcf5111 --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,21 @@ +.. Sphinx_project documentation master file, created by + sphinx-quickstart on Fri Sep 29 02:08:39 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Sphinx_project's documentation! +========================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` +