Skip to content

Commit

Permalink
added Sphinx documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaasRostock committed Jan 11, 2024
1 parent e4aff02 commit e943699
Show file tree
Hide file tree
Showing 26 changed files with 355 additions and 0 deletions.
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

%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
2 changes: 2 additions & 0 deletions docs/source/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../../CHANGELOG.md
```
3 changes: 3 additions & 0 deletions docs/source/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# LICENSE
```{include} ../../LICENSE
```
2 changes: 2 additions & 0 deletions docs/source/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../../README.md
```
2 changes: 2 additions & 0 deletions docs/source/STYLEGUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../../STYLEGUIDE.md
```
1 change: 1 addition & 0 deletions docs/source/_static/mypackage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
API Documentation
=================

.. toctree::
:maxdepth: 4

maritime-schema
3 changes: 3 additions & 0 deletions docs/source/cli.mypackage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. sphinx_argparse_cli::
:module: maritime-schema.cli.maritime-schema
:func: _argparser
7 changes: 7 additions & 0 deletions docs/source/cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CLI Documentation
=================

.. toctree::
:maxdepth: 2

cli.maritime_schema
75 changes: 75 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -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`
7 changes: 7 additions & 0 deletions docs/source/maritime_schema.api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
maritime\_schema.api module
===========================

.. automodule:: maritime_schema.api
:members:
:undoc-members:
:show-inheritance:
24 changes: 24 additions & 0 deletions docs/source/maritime_schema.rst
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions docs/source/maritime_schema.subpackage1.module1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
maritime\_schema.subpackage1.module1 module
===========================================

.. automodule:: maritime_schema.subpackage1.module1
:members:
:undoc-members:
:show-inheritance:
15 changes: 15 additions & 0 deletions docs/source/maritime_schema.subpackage1.rst
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions docs/source/maritime_schema.subpackage2.module2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
maritime\_schema.subpackage2.module2 module
===========================================

.. automodule:: maritime_schema.subpackage2.module2
:members:
:undoc-members:
:show-inheritance:
15 changes: 15 additions & 0 deletions docs/source/maritime_schema.subpackage2.rst
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions docs/source/mypackage.api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
maritime-schema.api module
====================

.. automodule:: maritime-schema.api
:members:
:undoc-members:
:show-inheritance:
25 changes: 25 additions & 0 deletions docs/source/mypackage.rst
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions docs/source/mypackage.subpackage1.module1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
maritime-schema.subpackage1.module1 module
====================================

.. automodule:: maritime-schema.subpackage1.module1
:members:
:undoc-members:
:show-inheritance:
15 changes: 15 additions & 0 deletions docs/source/mypackage.subpackage1.rst
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions docs/source/mypackage.subpackage2.module2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
maritime-schema.subpackage2.module2 module
====================================

.. automodule:: maritime-schema.subpackage2.module2
:members:
:undoc-members:
:show-inheritance:
15 changes: 15 additions & 0 deletions docs/source/mypackage.subpackage2.rst
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions docs/source/mypackage.utils.logging.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
maritime-schema.utils.logging module
==============================

.. automodule:: maritime-schema.utils.logging
:members:
:undoc-members:
:show-inheritance:
15 changes: 15 additions & 0 deletions docs/source/mypackage.utils.rst
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e943699

Please sign in to comment.