Skip to content

Commit

Permalink
#33 #37 activated docu and added rich package
Browse files Browse the repository at this point in the history
  • Loading branch information
marwern committed Aug 1, 2023
1 parent 1d9ad66 commit 0793285
Show file tree
Hide file tree
Showing 24 changed files with 1,459 additions and 71 deletions.
25 changes: 25 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
formats:
- pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
68 changes: 42 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PLCreX is a modular command-line interface (CLI) application tailored for IEC 61

<!-- [📄 PLCreX’s documentation](https://plcrex.readthedocs.io/en/latest/) [![Documentation Status](https://readthedocs.org/projects/plcrex/badge/?version=latest)](https://plcrex.readthedocs.io/en/latest/?badge=latest) -->

* [📄 PLCreX Wiki](#https://github.com/marwern/PLCreX/wiki)
* [📄 PLCreX Wiki](https://github.com/marwern/PLCreX/wiki)
* [🛠 Getting Started](#-getting-started)
* [💻 Commands](#-commands)
* [📜 Publications](#-publications)
Expand Down Expand Up @@ -46,8 +46,8 @@ Run ``pip install plcrex`` to get PLCreX using PyPI
plcrex\tools\ds2ts\_ds2ts.py 3 0 100%
plcrex\tools\fbd2ia\__init__.py 0 0 100%
plcrex\tools\fbd2ia\_fbd2ia.py 4 0 100%
plcrex\tools\fbd2st\__init__.py 0 0 100%
plcrex\tools\fbd2st\_fbd2st.py 4 0 100%
plcrex\tools\fbd-to-st\__init__.py 0 0 100%
plcrex\tools\fbd-to-st\_fbd2st.py 4 0 100%
plcrex\tools\iec_checker\__init__.py 0 0 100%
plcrex\tools\iec_checker\_iec_checker.py 4 0 100%
plcrex\tools\st2ast\__init__.py 0 0 100%
Expand All @@ -73,6 +73,9 @@ Run ``pip install plcrex`` to get PLCreX using PyPI

Usage: ``python -m plcrex [OPTIONS] COMMAND [ARGS]``

<img src="https://github.com/marwern/PLCreX/assets/92115516/fc3e338c-a4c1-4acf-b2e9-03fe2370da6a" width="400">


<table>
<tr>
<td><b>Usage</b></td>
Expand All @@ -87,20 +90,21 @@ Usage: ``python -m plcrex [OPTIONS] COMMAND [ARGS]``
--help: show details<br><br>
</td>
<td>
--fbd2st: call FBD-to-ST-Compiler<br>
--st2ast: call ST-Parser<br>
--ds2ts: call Test-Case-Generator<br>
--xml-val: call XML-Validator<br>
--iec-checker: call iec-checker<br>
--fbd-to-st: call FBD-to-ST-Compiler<br>
--iec-checker: call iec-checker<br>
--impact-analysis: call FBD I/O impact analysis<br>
--st-parser: call ST-Parser<br>
--test-case-gen: call Test-Case-Generator<br>
--xml-validator: call XML-Validator<br>
</td>
</tr>
<tr>
<td>python -m plcrex fbd2st [OPTIONS] SRC EXPORT</td>
<td>python -m plcrex fbd-to-st [OPTIONS] SRC EXPORT</td>
<td>
--bwd: use backward translation<br>
--formal: use formal parameter list<br>
--st2ast: run ST parser with exports<br>
--impact-analysis: check I/O impact analysis<br>
--st-parser: run ST parser with exports<br>
--help: show details<br><br>
</td>
<td>
Expand All @@ -109,51 +113,63 @@ Usage: ``python -m plcrex [OPTIONS] COMMAND [ARGS]``
</td>
</tr>
<tr>
<td>python -m plcrex st2ast [OPTIONS] SRC EXPORT</td>
<td>
--no-txt: no tree export as *.txt<br>
--no-dot: no tree export as *.dot<br>
--beckhoff: use Beckhoff TwinCAT ST grammar<br>
--help: show details<br><br>
python -m plcrex iec-checker [OPTIONS] SRC EXE</td>
<td>
--help_iec_checker: call iec-checker help <br>
--help: show details<br><br>
</td>
<td>
SRC: source path<br>
EXPORT: export directory path<br>
EXE: iec-checker path (*.exe)
</td>
</tr>
<tr>
<td>
python -m plcrex ds2ts [OPTIONS] FORMULA</td>
python -m plcrex impact-analysis [OPTIONS] SRC EXPORT</td>
<td>
--help: show details<br><br>
--help: show details<br><br>
</td>
<td>
FORMULA: formula in ST syntax<br>
SRC: source path<br>
EXPORT: export directory path<br>
</td>
</tr>
<tr>
<td>python -m plcrex st-parser [OPTIONS] SRC EXPORT</td>
<td>
--no-txt: no tree export as *.txt<br>
--no-dot: no tree export as *.dot<br>
--beckhoff: use Beckhoff TwinCAT ST grammar<br>
--help: show details<br><br>
</td>
<td>
SRC: source path<br>
EXPORT: export directory path<br>
</td>
</tr>
<tr>
<td>
python -m plcrex xml-val [OPTIONS] SRC</td>
python -m plcrex test-case-gen [OPTIONS] FORMULA</td>
<td>
--v201: use tc6_xml_v201.xsd<br>
--help: show details<br><br>
</td>
<td>
SRC: source path<br>
FORMULA: formula in ST syntax<br>
</td>
</tr>
<tr>
<td>
python -m plcrex iec-checker [OPTIONS] SRC EXE</td>
python -m plcrex xml-validator [OPTIONS] SRC</td>
<td>
--help_iec_checker: call iec-checker help <br>
--v201: use tc6_xml_v201.xsd<br>
--help: show details<br><br>
</td>
<td>
SRC: source path<br>
EXE: iec-checker path (*.exe)
</td>
</tr>

</table>


Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -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

if "%1" == "" goto help

%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.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
8 changes: 8 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
numpy
matplotlib
pandas
tensorflow
lightkurve
requests
sphinx==5.3.0
sphinx_rtd_theme==1.0.0
17 changes: 17 additions & 0 deletions docs/source/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# This file is part of PLCreX (https://github.com/marwern/PLCreX).
#
# Copyright (c) 2022-2023 Marcel Werner.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
114 changes: 114 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#
# This file is part of PLCreX (https://github.com/marwern/PLCreX).
#
# Copyright (c) 2022-2023 Marcel Werner.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#


# Configuration file for the Sphinx documentation builder.
#
import os
import sys
sys.path.insert(0, os.path.abspath("../"))

from plcrex import __app_name__, __version__, __owner__, __copyright__

# -- Project information

project = __app_name__
copyright = __copyright__
author = __owner__

release = __version__
version = __version__

# -- General configuration

extensions = [
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx_rtd_theme',
]

intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
}
intersphinx_disabled_domains = ['std']

templates_path = ['_templates']

# -- Options for HTML output

html_theme = 'sphinx_rtd_theme'
html_theme_options = {
'collapse_navigation': True,
'sticky_navigation': True,
'navigation_depth': 4,
'includehidden': True,
'titles_only': False
}

# The markdown parser
source_parsers = {
'.md': 'recommonmark.parser.CommonMarkParser',
}

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst', '.md']
# source_suffix = {
# '.rst': 'restructuredtext',
# '.md': 'markdown'
# }

# The master toctree document.
master_doc = 'index'

# -- Options for EPUB output
epub_show_urls = 'footnote'

# -- Options for HTML output ----------------------------------------------


# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'globaltoc.html',
'navigation.html',
]
}
Loading

0 comments on commit 0793285

Please sign in to comment.