From efc7ca217976ec158cada5e6577f39fd2c8be732 Mon Sep 17 00:00:00 2001 From: Oscar Gustafsson <oscar.gustafsson@gmail.com> Date: Fri, 2 Sep 2022 21:24:04 +0200 Subject: [PATCH] Swap to sphinx for doc build --- .gitlab-ci.yml | 5 ++- b_asic/schedule.py | 3 +- docs_sphinx/api/core_operations.rst | 13 +++++++ docs_sphinx/api/graph_component.rst | 13 +++++++ docs_sphinx/api/index.rst | 16 +++++++++ docs_sphinx/api/operation.rst | 11 ++++++ docs_sphinx/api/port.rst | 13 +++++++ docs_sphinx/api/schedule.rst | 9 +++++ docs_sphinx/api/signal.rst | 9 +++++ docs_sphinx/api/signal_flow_graph.rst | 9 +++++ docs_sphinx/api/simulation.rst | 9 +++++ docs_sphinx/api/special_operations.rst | 13 +++++++ docs_sphinx/conf.py | 47 ++++++++++++++++++++++++++ docs_sphinx/index.rst | 28 +++++++++++++++ docs_sphinx/make.bat | 35 +++++++++++++++++++ 15 files changed, 229 insertions(+), 4 deletions(-) create mode 100644 docs_sphinx/api/core_operations.rst create mode 100644 docs_sphinx/api/graph_component.rst create mode 100644 docs_sphinx/api/index.rst create mode 100644 docs_sphinx/api/operation.rst create mode 100644 docs_sphinx/api/port.rst create mode 100644 docs_sphinx/api/schedule.rst create mode 100644 docs_sphinx/api/signal.rst create mode 100644 docs_sphinx/api/signal_flow_graph.rst create mode 100644 docs_sphinx/api/simulation.rst create mode 100644 docs_sphinx/api/special_operations.rst create mode 100644 docs_sphinx/conf.py create mode 100644 docs_sphinx/index.rst create mode 100644 docs_sphinx/make.bat diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 144ff5df..16484b83 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,9 +52,8 @@ run-test-qt: pages: image: python:3.10 script: - - apt-get install --yes doxygen - - doxygen - - cp -r doc/html public + - pip install -U sphinx furo + - sphinx-build -b html . public artifacts: paths: - public diff --git a/b_asic/schedule.py b/b_asic/schedule.py index 83f3fb49..1d50607a 100644 --- a/b_asic/schedule.py +++ b/b_asic/schedule.py @@ -1,4 +1,5 @@ -"""B-ASIC Schedule Module. +""" +B-ASIC Schedule Module. Contains the schedule class for scheduling operations in an SFG. """ diff --git a/docs_sphinx/api/core_operations.rst b/docs_sphinx/api/core_operations.rst new file mode 100644 index 00000000..c362191c --- /dev/null +++ b/docs_sphinx/api/core_operations.rst @@ -0,0 +1,13 @@ +************************** +``b_asic.core_operations`` +************************** + +.. inheritance-diagram:: b_asic.core_operations + :parts: 1 + :top-classes: b_asic.graph_component.GraphComponent, b_asic.port.SignalSourceProvider + +.. automodule:: b_asic.core_operations + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs_sphinx/api/graph_component.rst b/docs_sphinx/api/graph_component.rst new file mode 100644 index 00000000..5c599035 --- /dev/null +++ b/docs_sphinx/api/graph_component.rst @@ -0,0 +1,13 @@ +************************** +``b_asic.graph_component`` +************************** + +.. inheritance-diagram:: b_asic.graph_component + :parts: 1 + :top-classes: b_asic.graph_component.GraphComponent + +.. automodule:: b_asic.graph_component + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs_sphinx/api/index.rst b/docs_sphinx/api/index.rst new file mode 100644 index 00000000..6d4e5707 --- /dev/null +++ b/docs_sphinx/api/index.rst @@ -0,0 +1,16 @@ +.. _api: + +API +=== +.. toctree:: + :maxdepth: 1 + + core_operations.rst + graph_component.rst + operation.rst + port.rst + schedule.rst + signal.rst + signal_flow_graph.rst + simulation.rst + special_operations.rst diff --git a/docs_sphinx/api/operation.rst b/docs_sphinx/api/operation.rst new file mode 100644 index 00000000..2d96ba5a --- /dev/null +++ b/docs_sphinx/api/operation.rst @@ -0,0 +1,11 @@ +******************** +``b_asic.operation`` +******************** + +.. inheritance-diagram:: b_asic.operation + :parts: 1 + :top-classes: b_asic.graph_component.GraphComponent, b_asic.port.SignalSourceProvider + +.. automodule:: b_asic.operation + :members: + :undoc-members: diff --git a/docs_sphinx/api/port.rst b/docs_sphinx/api/port.rst new file mode 100644 index 00000000..f34f4301 --- /dev/null +++ b/docs_sphinx/api/port.rst @@ -0,0 +1,13 @@ +*************** +``b_asic.port`` +*************** + +.. inheritance-diagram:: b_asic.port + :parts: 1 + :top-classes: b_asic.port.Port, b_asic.port.SignalSourceProvider + +.. automodule:: b_asic.port + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs_sphinx/api/schedule.rst b/docs_sphinx/api/schedule.rst new file mode 100644 index 00000000..a6f88aca --- /dev/null +++ b/docs_sphinx/api/schedule.rst @@ -0,0 +1,9 @@ +******************* +``b_asic.schedule`` +******************* +:mod:`.schedule` + +.. automodule:: b_asic.schedule + :members: + :undoc-members: + :show-inheritance: diff --git a/docs_sphinx/api/signal.rst b/docs_sphinx/api/signal.rst new file mode 100644 index 00000000..29979486 --- /dev/null +++ b/docs_sphinx/api/signal.rst @@ -0,0 +1,9 @@ +******************* +``b_asic.signal`` +******************* + +.. automodule:: b_asic.signal + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs_sphinx/api/signal_flow_graph.rst b/docs_sphinx/api/signal_flow_graph.rst new file mode 100644 index 00000000..ee2f7fb0 --- /dev/null +++ b/docs_sphinx/api/signal_flow_graph.rst @@ -0,0 +1,9 @@ +**************************** +``b_asic.signal_flow_graph`` +**************************** + +.. automodule:: b_asic.signal_flow_graph + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs_sphinx/api/simulation.rst b/docs_sphinx/api/simulation.rst new file mode 100644 index 00000000..580596f5 --- /dev/null +++ b/docs_sphinx/api/simulation.rst @@ -0,0 +1,9 @@ +********************* +``b_asic.simulation`` +********************* + +.. automodule:: b_asic.simulation + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs_sphinx/api/special_operations.rst b/docs_sphinx/api/special_operations.rst new file mode 100644 index 00000000..d80e4460 --- /dev/null +++ b/docs_sphinx/api/special_operations.rst @@ -0,0 +1,13 @@ +***************************** +``b_asic.special_operations`` +***************************** + +.. inheritance-diagram:: b_asic.special_operations + :parts: 1 + :top-classes: b_asic.graph_component.GraphComponent, b_asic.port.SignalSourceProvider + +.. automodule:: b_asic.special_operations + :members: + :undoc-members: + :show-inheritance: + diff --git a/docs_sphinx/conf.py b/docs_sphinx/conf.py new file mode 100644 index 00000000..b5869c1a --- /dev/null +++ b/docs_sphinx/conf.py @@ -0,0 +1,47 @@ +# 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 +import shutil + +project = 'B-ASIC' +copyright = '2020-2022, Oscar Gustafsson et al' +author = 'Oscar Gustafsson et al' +html_logo = "../logo_tiny.png" + +pygments_style = 'sphinx' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.autosummary', + 'sphinx.ext.inheritance_diagram', + 'sphinx.ext.intersphinx', + 'numpydoc', +] + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +autodoc_docstring_signature = True + +intersphinx_mapping = { + 'python': ('https://docs.python.org/3/', None), +} + +numpydoc_show_class_members = False + +inheritance_node_attrs = dict(fontsize=16) + +graphviz_dot = shutil.which('dot') + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'furo' +html_static_path = ['_static'] diff --git a/docs_sphinx/index.rst b/docs_sphinx/index.rst new file mode 100644 index 00000000..fd2eff3d --- /dev/null +++ b/docs_sphinx/index.rst @@ -0,0 +1,28 @@ +.. B-ASIC documentation master file, created by + sphinx-quickstart on Fri Sep 2 20:10:06 2022. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to B-ASIC's documentation! +================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + +Table of Contents +^^^^^^^^^^^^^^^^^ +.. toctree:: + :maxdepth: 2 + + self + api/index diff --git a/docs_sphinx/make.bat b/docs_sphinx/make.bat new file mode 100644 index 00000000..32bb2452 --- /dev/null +++ b/docs_sphinx/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +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 -- GitLab