From e9436995b3f5e1ec3d04afcd99c1e5a53e5ce7cf Mon Sep 17 00:00:00 2001 From: Claas Date: Thu, 11 Jan 2024 17:49:39 +0100 Subject: [PATCH] added Sphinx documentation --- docs/Makefile | 20 +++++ docs/make.bat | 35 +++++++++ docs/source/CHANGELOG.md | 2 + docs/source/LICENSE.md | 3 + docs/source/README.md | 2 + docs/source/STYLEGUIDE.md | 2 + docs/source/_static/mypackage.svg | 1 + docs/source/api.rst | 7 ++ docs/source/cli.mypackage.rst | 3 + docs/source/cli.rst | 7 ++ docs/source/conf.py | 75 +++++++++++++++++++ docs/source/index.rst | 25 +++++++ docs/source/maritime_schema.api.rst | 7 ++ docs/source/maritime_schema.rst | 24 ++++++ .../maritime_schema.subpackage1.module1.rst | 7 ++ docs/source/maritime_schema.subpackage1.rst | 15 ++++ .../maritime_schema.subpackage2.module2.rst | 7 ++ docs/source/maritime_schema.subpackage2.rst | 15 ++++ docs/source/mypackage.api.rst | 7 ++ docs/source/mypackage.rst | 25 +++++++ docs/source/mypackage.subpackage1.module1.rst | 7 ++ docs/source/mypackage.subpackage1.rst | 15 ++++ docs/source/mypackage.subpackage2.module2.rst | 7 ++ docs/source/mypackage.subpackage2.rst | 15 ++++ docs/source/mypackage.utils.logging.rst | 7 ++ docs/source/mypackage.utils.rst | 15 ++++ 26 files changed, 355 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/make.bat create mode 100644 docs/source/CHANGELOG.md create mode 100644 docs/source/LICENSE.md create mode 100644 docs/source/README.md create mode 100644 docs/source/STYLEGUIDE.md create mode 100644 docs/source/_static/mypackage.svg create mode 100644 docs/source/api.rst create mode 100644 docs/source/cli.mypackage.rst create mode 100644 docs/source/cli.rst create mode 100644 docs/source/conf.py create mode 100644 docs/source/index.rst create mode 100644 docs/source/maritime_schema.api.rst create mode 100644 docs/source/maritime_schema.rst create mode 100644 docs/source/maritime_schema.subpackage1.module1.rst create mode 100644 docs/source/maritime_schema.subpackage1.rst create mode 100644 docs/source/maritime_schema.subpackage2.module2.rst create mode 100644 docs/source/maritime_schema.subpackage2.rst create mode 100644 docs/source/mypackage.api.rst create mode 100644 docs/source/mypackage.rst create mode 100644 docs/source/mypackage.subpackage1.module1.rst create mode 100644 docs/source/mypackage.subpackage1.rst create mode 100644 docs/source/mypackage.subpackage2.module2.rst create mode 100644 docs/source/mypackage.subpackage2.rst create mode 100644 docs/source/mypackage.utils.logging.rst create mode 100644 docs/source/mypackage.utils.rst diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /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 = 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/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..7ecca52 --- /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=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% -a -E +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/source/CHANGELOG.md b/docs/source/CHANGELOG.md new file mode 100644 index 0000000..ff772da --- /dev/null +++ b/docs/source/CHANGELOG.md @@ -0,0 +1,2 @@ +```{include} ../../CHANGELOG.md +``` \ No newline at end of file diff --git a/docs/source/LICENSE.md b/docs/source/LICENSE.md new file mode 100644 index 0000000..947acdb --- /dev/null +++ b/docs/source/LICENSE.md @@ -0,0 +1,3 @@ +# LICENSE +```{include} ../../LICENSE +``` \ No newline at end of file diff --git a/docs/source/README.md b/docs/source/README.md new file mode 100644 index 0000000..060259b --- /dev/null +++ b/docs/source/README.md @@ -0,0 +1,2 @@ +```{include} ../../README.md +``` \ No newline at end of file diff --git a/docs/source/STYLEGUIDE.md b/docs/source/STYLEGUIDE.md new file mode 100644 index 0000000..8648352 --- /dev/null +++ b/docs/source/STYLEGUIDE.md @@ -0,0 +1,2 @@ +```{include} ../../STYLEGUIDE.md +``` \ No newline at end of file diff --git a/docs/source/_static/mypackage.svg b/docs/source/_static/mypackage.svg new file mode 100644 index 0000000..1e02cbe --- /dev/null +++ b/docs/source/_static/mypackage.svg @@ -0,0 +1 @@ +mypackagelogo svg1224 x 1223 \ No newline at end of file diff --git a/docs/source/api.rst b/docs/source/api.rst new file mode 100644 index 0000000..f9476cf --- /dev/null +++ b/docs/source/api.rst @@ -0,0 +1,7 @@ +API Documentation +================= + +.. toctree:: + :maxdepth: 4 + + maritime-schema diff --git a/docs/source/cli.mypackage.rst b/docs/source/cli.mypackage.rst new file mode 100644 index 0000000..2e91dd4 --- /dev/null +++ b/docs/source/cli.mypackage.rst @@ -0,0 +1,3 @@ +.. sphinx_argparse_cli:: + :module: maritime-schema.cli.maritime-schema + :func: _argparser diff --git a/docs/source/cli.rst b/docs/source/cli.rst new file mode 100644 index 0000000..3e02ae3 --- /dev/null +++ b/docs/source/cli.rst @@ -0,0 +1,7 @@ +CLI Documentation +================= + +.. toctree:: + :maxdepth: 2 + + cli.maritime_schema diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..9bc9fac --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,75 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys + +sys.path.insert(0, os.path.abspath("../../src")) + + +# -- Project information ----------------------------------------------------- + +project = "maritime-schema" +copyright = "2023, Author One" +author = "Author One, Author Two, Author Three" + +# The full version, including alpha/beta/rc tags +release = "0.1.4" + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "myst_parser", + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", + "sphinx_argparse_cli", +] + +# The file extensions of source files. +source_suffix = { + ".rst": "restructuredtext", + ".md": "markdown", +} + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "furo" +html_logo = "_static/maritime-schema.svg" + +# 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"] + +autodoc_default_options = { + "member-order": "bysource", + "undoc-members": True, + "exclude-members": "__weakref__", +} +autodoc_preserve_defaults = True + +myst_heading_anchors = 3 diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..130efa2 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,25 @@ +.. maritime-schema documentation master file, created by + sphinx-quickstart on Wed Jul 6 21:16:21 2022. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +maritime-schema: Example Python Package +========================================= + +.. toctree:: + :maxdepth: 4 + :caption: Contents: + + README + CHANGELOG + LICENSE + api + cli + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/source/maritime_schema.api.rst b/docs/source/maritime_schema.api.rst new file mode 100644 index 0000000..7526b51 --- /dev/null +++ b/docs/source/maritime_schema.api.rst @@ -0,0 +1,7 @@ +maritime\_schema.api module +=========================== + +.. automodule:: maritime_schema.api + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/maritime_schema.rst b/docs/source/maritime_schema.rst new file mode 100644 index 0000000..0171ab7 --- /dev/null +++ b/docs/source/maritime_schema.rst @@ -0,0 +1,24 @@ +maritime\_schema package +======================== + +.. automodule:: maritime_schema + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + maritime_schema.subpackage1 + maritime_schema.subpackage2 + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + maritime_schema.api diff --git a/docs/source/maritime_schema.subpackage1.module1.rst b/docs/source/maritime_schema.subpackage1.module1.rst new file mode 100644 index 0000000..190d0d4 --- /dev/null +++ b/docs/source/maritime_schema.subpackage1.module1.rst @@ -0,0 +1,7 @@ +maritime\_schema.subpackage1.module1 module +=========================================== + +.. automodule:: maritime_schema.subpackage1.module1 + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/maritime_schema.subpackage1.rst b/docs/source/maritime_schema.subpackage1.rst new file mode 100644 index 0000000..305f860 --- /dev/null +++ b/docs/source/maritime_schema.subpackage1.rst @@ -0,0 +1,15 @@ +maritime\_schema.subpackage1 package +==================================== + +.. automodule:: maritime_schema.subpackage1 + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + maritime_schema.subpackage1.module1 diff --git a/docs/source/maritime_schema.subpackage2.module2.rst b/docs/source/maritime_schema.subpackage2.module2.rst new file mode 100644 index 0000000..2685e99 --- /dev/null +++ b/docs/source/maritime_schema.subpackage2.module2.rst @@ -0,0 +1,7 @@ +maritime\_schema.subpackage2.module2 module +=========================================== + +.. automodule:: maritime_schema.subpackage2.module2 + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/maritime_schema.subpackage2.rst b/docs/source/maritime_schema.subpackage2.rst new file mode 100644 index 0000000..f0736f9 --- /dev/null +++ b/docs/source/maritime_schema.subpackage2.rst @@ -0,0 +1,15 @@ +maritime\_schema.subpackage2 package +==================================== + +.. automodule:: maritime_schema.subpackage2 + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + maritime_schema.subpackage2.module2 diff --git a/docs/source/mypackage.api.rst b/docs/source/mypackage.api.rst new file mode 100644 index 0000000..d190759 --- /dev/null +++ b/docs/source/mypackage.api.rst @@ -0,0 +1,7 @@ +maritime-schema.api module +==================== + +.. automodule:: maritime-schema.api + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/mypackage.rst b/docs/source/mypackage.rst new file mode 100644 index 0000000..8f64d0e --- /dev/null +++ b/docs/source/mypackage.rst @@ -0,0 +1,25 @@ +maritime-schema package +================= + +.. automodule:: maritime-schema + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + maritime-schema.subpackage1 + maritime-schema.subpackage2 + maritime-schema.utils + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + maritime-schema.api diff --git a/docs/source/mypackage.subpackage1.module1.rst b/docs/source/mypackage.subpackage1.module1.rst new file mode 100644 index 0000000..c8fe5c0 --- /dev/null +++ b/docs/source/mypackage.subpackage1.module1.rst @@ -0,0 +1,7 @@ +maritime-schema.subpackage1.module1 module +==================================== + +.. automodule:: maritime-schema.subpackage1.module1 + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/mypackage.subpackage1.rst b/docs/source/mypackage.subpackage1.rst new file mode 100644 index 0000000..b0daa82 --- /dev/null +++ b/docs/source/mypackage.subpackage1.rst @@ -0,0 +1,15 @@ +maritime-schema.subpackage1 package +============================= + +.. automodule:: maritime-schema.subpackage1 + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + maritime-schema.subpackage1.module1 diff --git a/docs/source/mypackage.subpackage2.module2.rst b/docs/source/mypackage.subpackage2.module2.rst new file mode 100644 index 0000000..4a14d22 --- /dev/null +++ b/docs/source/mypackage.subpackage2.module2.rst @@ -0,0 +1,7 @@ +maritime-schema.subpackage2.module2 module +==================================== + +.. automodule:: maritime-schema.subpackage2.module2 + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/mypackage.subpackage2.rst b/docs/source/mypackage.subpackage2.rst new file mode 100644 index 0000000..cf887e7 --- /dev/null +++ b/docs/source/mypackage.subpackage2.rst @@ -0,0 +1,15 @@ +maritime-schema.subpackage2 package +============================= + +.. automodule:: maritime-schema.subpackage2 + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + maritime-schema.subpackage2.module2 diff --git a/docs/source/mypackage.utils.logging.rst b/docs/source/mypackage.utils.logging.rst new file mode 100644 index 0000000..8efc0fc --- /dev/null +++ b/docs/source/mypackage.utils.logging.rst @@ -0,0 +1,7 @@ +maritime-schema.utils.logging module +============================== + +.. automodule:: maritime-schema.utils.logging + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/mypackage.utils.rst b/docs/source/mypackage.utils.rst new file mode 100644 index 0000000..10a3615 --- /dev/null +++ b/docs/source/mypackage.utils.rst @@ -0,0 +1,15 @@ +maritime-schema.utils package +======================= + +.. automodule:: maritime-schema.utils + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + maritime-schema.utils.logging