Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sphinxcontrib-apidoc for automatic API docs #116

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ coverage.xml
# Sphinx documentation
doc/_build/
doc/generated/
doc/api/

# PyBuilder
target/
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
- pangeo-sphinx-book-theme
- pytest
- sphinx
- sphinxcontrib-apidoc
- sphinx-autosummary-accessors
- sphinx-copybutton
- xarray
Expand Down
1 change: 1 addition & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ help:
clean:
rm -rf $(BUILDDIR)/*
rm -rf generated/*
rm -rf api/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
Expand Down
35 changes: 0 additions & 35 deletions doc/api.rst

This file was deleted.

8 changes: 8 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"IPython.sphinxext.ipython_console_highlighting",
"sphinx_autosummary_accessors",
"sphinx_copybutton",
"sphinxcontrib.apidoc",
]

# never execute notebooks: avoids lots of expensive imports on rtd
Expand Down Expand Up @@ -83,6 +84,13 @@ def setup(app):
numpydoc_class_members_toctree = False
numpydoc_show_class_members = False

# API docs

apidoc_module_dir = "../xbatcher"
apidoc_output_dir = "api"
apidoc_excluded_paths = []
apidoc_separate_modules = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates", sphinx_autosummary_accessors.templates_path]

Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ or via a built-in `Xarray accessor <http://xarray.pydata.org/en/stable/internals
:caption: Contents:

roadmap
api
API reference <api/modules>
demo
contributing