From d66326ac58743db9281d2166e8a2e109852a7f56 Mon Sep 17 00:00:00 2001 From: Jake Stevens-Haas <37048747+Jacob-Stevens-Haas@users.noreply.github.com> Date: Thu, 29 Dec 2022 12:52:22 -0800 Subject: [PATCH] DOC: move from make to sphinx, incl apidoc --- .readthedocs.yaml | 7 ++++--- docs/.gitignore | 2 ++ docs/source/conf.py | 7 ++++++- docs/source/tehom.datalib.rst | 7 ------- docs/source/tehom.rst | 10 ++++++---- docs/source/tehom.shared.rst | 7 ------- pyproject.toml | 3 ++- 7 files changed, 20 insertions(+), 23 deletions(-) create mode 100644 docs/.gitignore delete mode 100644 docs/source/tehom.datalib.rst delete mode 100644 docs/source/tehom.shared.rst diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 58f7024..4f276a4 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -8,10 +8,11 @@ version: 2 # Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/source/conf.py + fail_on_warning: true # Optionally build your docs in additional formats such as PDF -formats: - - pdf +# formats: +# - pdf # Optionally set the version of Python and requirements required to build your docs python: @@ -20,4 +21,4 @@ python: - method: pip path: . extra_requirements: - - dev + - docs diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..c2ec4cc --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +_build +source/api diff --git a/docs/source/conf.py b/docs/source/conf.py index 7f95ee8..20d5bb7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,7 +13,7 @@ # import os import sys from pathlib import Path -sys.path.insert(0, str(Path(__file__).parent.parent.parent)) +# sys.path.insert(0, str(Path(__file__).parent.parent.parent)) from tehom._version import get_versions revision = get_versions()['version'] @@ -37,6 +37,7 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + 'sphinxcontrib.apidoc', 'sphinx.ext.autodoc', 'sphinx.ext.todo', #optional. Allows inline "todo:" 'sphinx.ext.imgmath', #optional. Allows LaTeX equations @@ -44,6 +45,10 @@ 'sphinx.ext.githubpages', #Adds .nojekyll file ] +apidoc_module_dir = str(Path("../..").resolve() / project) +apidoc_output_dir = str(Path().resolve()) +print(apidoc_output_dir) + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/source/tehom.datalib.rst b/docs/source/tehom.datalib.rst deleted file mode 100644 index 6422fca..0000000 --- a/docs/source/tehom.datalib.rst +++ /dev/null @@ -1,7 +0,0 @@ -tehom.datalib module -==================== - -.. automodule:: tehom.datalib - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/tehom.rst b/docs/source/tehom.rst index 4e57c69..d0f4530 100644 --- a/docs/source/tehom.rst +++ b/docs/source/tehom.rst @@ -4,11 +4,13 @@ tehom package Submodules ---------- -.. toctree:: - :maxdepth: 4 +tehom.downloads module +---------------------- - tehom.datalib - tehom.shared +.. automodule:: tehom.downloads + :members: + :undoc-members: + :show-inheritance: Module contents --------------- diff --git a/docs/source/tehom.shared.rst b/docs/source/tehom.shared.rst deleted file mode 100644 index b6c360f..0000000 --- a/docs/source/tehom.shared.rst +++ /dev/null @@ -1,7 +0,0 @@ -tehom.shared module -=================== - -.. automodule:: tehom.shared - :members: - :undoc-members: - :show-inheritance: diff --git a/pyproject.toml b/pyproject.toml index 247aa9d..5142043 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,8 @@ dev = [ "build~=0.9" ] docs = [ - "sphinx==4.0.2", + "sphinx==6.0.0", + "sphinxcontrib-apidoc", ] [tool.setuptools]