diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..dfda2d68 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,40 @@ +name: docs + +on: + push: + branches: + - main + - docs + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install sphinx sphinx_rtd_theme + pip install .[all] + + - name: Clean previous builds + working-directory: ./docs + run: make clean + + - name: Generate .rst files using sphinx-apidoc + working-directory: ./docs + run: sphinx-apidoc -o . ../src/aviary + + - name: Build the Sphinx documentation + working-directory: ./docs + run: make html + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + cname: aviary.bio + publish_dir: docs/_build/html diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d4bb2cbb --- /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/conf.py b/docs/conf.py new file mode 100644 index 00000000..7de65d53 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,35 @@ +# 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 os +import sys +sys.path.insert(0, os.path.abspath('../src/aviary')) + +project = 'aviary' +copyright = '2024, FutureHouse' +author = 'FutureHouse' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.napoleon', + 'sphinx.ext.viewcode', + 'sphinx.ext.autosummary', +] + +autosummary_generate = True + +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 = 'alabaster' +html_static_path = ['_static'] diff --git a/docs/core.rst b/docs/core.rst new file mode 100644 index 00000000..d194de38 --- /dev/null +++ b/docs/core.rst @@ -0,0 +1,7 @@ +core module +=========== + +.. automodule:: core + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/env.rst b/docs/env.rst new file mode 100644 index 00000000..cf32d370 --- /dev/null +++ b/docs/env.rst @@ -0,0 +1,7 @@ +env module +========== + +.. automodule:: env + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/env_client.rst b/docs/env_client.rst new file mode 100644 index 00000000..eb6b42aa --- /dev/null +++ b/docs/env_client.rst @@ -0,0 +1,7 @@ +env\_client module +================== + +.. automodule:: env_client + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..33173a83 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,14 @@ +.. aviary documentation master file, created by + sphinx-quickstart on Fri Oct 25 22:15:51 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +aviary documentation +==================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + modules + diff --git a/docs/main.rst b/docs/main.rst new file mode 100644 index 00000000..eace87b8 --- /dev/null +++ b/docs/main.rst @@ -0,0 +1,7 @@ +main module +=========== + +.. automodule:: main + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..32bb2452 --- /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/docs/message.rst b/docs/message.rst new file mode 100644 index 00000000..c96f9d6c --- /dev/null +++ b/docs/message.rst @@ -0,0 +1,7 @@ +message module +============== + +.. automodule:: message + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/modules.rst b/docs/modules.rst new file mode 100644 index 00000000..bbf59431 --- /dev/null +++ b/docs/modules.rst @@ -0,0 +1,14 @@ +aviary +====== + +.. toctree:: + :maxdepth: 4 + + core + env + env_client + main + message + render + tools + utils diff --git a/docs/render.rst b/docs/render.rst new file mode 100644 index 00000000..ab7f6ed2 --- /dev/null +++ b/docs/render.rst @@ -0,0 +1,7 @@ +render module +============= + +.. automodule:: render + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/tools.rst b/docs/tools.rst new file mode 100644 index 00000000..d49769a0 --- /dev/null +++ b/docs/tools.rst @@ -0,0 +1,45 @@ +tools package +============= + +Submodules +---------- + +tools.argref module +------------------- + +.. automodule:: tools.argref + :members: + :undoc-members: + :show-inheritance: + +tools.base module +----------------- + +.. automodule:: tools.base + :members: + :undoc-members: + :show-inheritance: + +tools.server module +------------------- + +.. automodule:: tools.server + :members: + :undoc-members: + :show-inheritance: + +tools.utils module +------------------ + +.. automodule:: tools.utils + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: tools + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/utils.rst b/docs/utils.rst new file mode 100644 index 00000000..44cef9ed --- /dev/null +++ b/docs/utils.rst @@ -0,0 +1,7 @@ +utils module +============ + +.. automodule:: utils + :members: + :undoc-members: + :show-inheritance: