From d384ff1da5c98a3c94e5ed59ae7496c2e64846b8 Mon Sep 17 00:00:00 2001 From: Tim Suhling Date: Fri, 12 Jul 2024 11:20:33 +0200 Subject: Set up documentation --- .gitignore | 3 +++ docs/Makefile | 20 ++++++++++++++++++++ docs/api.rst | 6 ++++++ docs/conf.py | 34 ++++++++++++++++++++++++++++++++++ docs/index.rst | 21 +++++++++++++++++++++ docs/make.bat | 35 +++++++++++++++++++++++++++++++++++ schroedinger/schroedinger.py | 15 +++++++++++++++ 7 files changed, 134 insertions(+) create mode 100644 .gitignore create mode 100644 docs/Makefile create mode 100644 docs/api.rst create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/make.bat create mode 100644 schroedinger/schroedinger.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..93ab237 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +docs/_build +.idea/ +schroedinger/__pycache__ diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/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 = . +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/docs/api.rst b/docs/api.rst new file mode 100644 index 0000000..d3bfedf --- /dev/null +++ b/docs/api.rst @@ -0,0 +1,6 @@ +**************** +Schroedinger API +**************** + +.. automodule:: schroedinger + :members: diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..e7dd896 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,34 @@ +# 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 + +from pathlib import Path +import sys +sys.path.insert(0, str(Path.cwd().parent/'schroedinger')) + + +project = 'schroedinger' +copyright = '2024, Thomas Albers Raviola, Tim Suhling' +author = 'Thomas Albers Raviola, Tim Suhling' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.napoleon', + 'sphinx.ext.mathjax' +] + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'sphinx_book_theme' +html_static_path = ['_static'] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..acdfc79 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,21 @@ +.. schroedinger documentation master file, created by + sphinx-quickstart on Fri Jul 12 10:53:36 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to schroedinger's documentation! +======================================== + +.. toctree:: + :maxdepth: 2 + + api + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..32bb245 --- /dev/null +++ b/docs/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 diff --git a/schroedinger/schroedinger.py b/schroedinger/schroedinger.py new file mode 100644 index 0000000..c13a881 --- /dev/null +++ b/schroedinger/schroedinger.py @@ -0,0 +1,15 @@ + +def hello(): + """ + This is a description :) + :return: None + """ + print('Hello') + + +def main(): + hello() + + +if __name__ == "__main__": + main() -- cgit v1.2.3