diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 697c73d..a4a3640 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,4 +10,5 @@ sphinx: python: install: + - requirements: requirements/base.txt - requirements: requirements/docs.txt diff --git a/docs/api/cli.rst b/docs/api/cli.rst new file mode 100644 index 0000000..f5a1a10 --- /dev/null +++ b/docs/api/cli.rst @@ -0,0 +1,7 @@ +CLI +=== + +.. automodule:: src.cli + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/data_sources.rst b/docs/api/data_sources.rst new file mode 100644 index 0000000..857f2cd --- /dev/null +++ b/docs/api/data_sources.rst @@ -0,0 +1,32 @@ +Data Sources +============ + +.. automodule:: src.data_sources + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: src.data_sources.base + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: src.data_sources.pypi + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: src.data_sources.cran + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: src.data_sources.conda + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: src.data_sources.github + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/index.rst b/docs/api/index.rst new file mode 100644 index 0000000..683549b --- /dev/null +++ b/docs/api/index.rst @@ -0,0 +1,10 @@ +API Reference +============= + +.. toctree:: + :maxdepth: 2 + + cli + utils + data_sources + reports diff --git a/docs/api/reports.rst b/docs/api/reports.rst new file mode 100644 index 0000000..1cafe87 --- /dev/null +++ b/docs/api/reports.rst @@ -0,0 +1,32 @@ +Reports +======= + +.. automodule:: src.reports + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: src.reports.base + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: src.reports.pypi + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: src.reports.cran + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: src.reports.bioconda + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: src.reports.github + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/utils.rst b/docs/api/utils.rst new file mode 100644 index 0000000..7bc1e84 --- /dev/null +++ b/docs/api/utils.rst @@ -0,0 +1,7 @@ +Utilities +========= + +.. automodule:: src.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/conf.py b/docs/conf.py index d85e556..6cef826 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,6 +3,12 @@ # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html +import os +import sys + +# Add the repository root to sys.path so that autodoc can import the source modules. +sys.path.insert(0, os.path.abspath("..")) + # -- Project information ----------------------------------------------------- project = "specdatri_reporting" copyright = "2024, RECETOX" @@ -11,11 +17,26 @@ # -- General configuration --------------------------------------------------- extensions = [ "myst_parser", + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", + "sphinx.ext.viewcode", ] templates_path = ["_templates"] exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] +# -- Autodoc configuration --------------------------------------------------- +autodoc_member_order = "bysource" +autodoc_default_options = { + "members": True, + "undoc-members": True, + "show-inheritance": True, +} + +# -- Napoleon configuration (Google-style docstrings) ------------------------- +napoleon_google_docstring = True +napoleon_numpy_docstring = False + # -- Options for HTML output ------------------------------------------------- html_theme = "sphinx_rtd_theme" html_static_path = ["_static"] diff --git a/docs/index.md b/docs/index.md index b137e81..e965447 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,3 +2,11 @@ ```{include} ../README.md ``` + +```{toctree} +:maxdepth: 2 +:caption: API Reference +:hidden: + +api/index +```