Skip to content

Commit

Permalink
sphinxcontrib apidoc
Browse files Browse the repository at this point in the history
  • Loading branch information
trexfeathers committed Feb 23, 2022
1 parent f549ac3 commit d38b722
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 0 additions & 4 deletions docs/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

API_SOURCE = ../../esmf_regrid

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Expand All @@ -18,7 +16,5 @@ help:

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
# Start by auto-generating the API files.
%: Makefile
sphinx-apidoc -f -e -H API -o "$(SOURCEDIR)/_api_generated" "$(API_SOURCE)" "$(API_SOURCE)/tests"
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 changes: 13 additions & 1 deletion docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinxcontrib.apidoc",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -118,6 +119,17 @@
}


# -- todo_ configuration -----------------------------------------------
# -- todo_ extension ----------------------------------------------------------
# See https://www.sphinx-doc.org/en/master/usage/extensions/todo.html
todo_include_todos = True


# -- apidoc extension ---------------------------------------------------------
# See https://github.com/sphinx-contrib/apidoc
module_dir = source_code_root / "esmf_regrid"

apidoc_module_dir = str(module_dir)
apidoc_output_dir = str(Path(__file__).parent / "_api_generated")
apidoc_excluded_paths = [str(module_dir / "tests")]
apidoc_separate_modules = True
apidoc_extra_args = ["-H", "API"]
1 change: 1 addition & 0 deletions requirements/py38.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ dependencies:
- pydata-sphinx-theme
- sphinx
- sphinx-copybutton
- sphinxcontrib-apidoc

0 comments on commit d38b722

Please sign in to comment.