summaryrefslogtreecommitdiff
path: root/docs/conf.py
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2022-07-29 12:22:35 +0300
committerJulian Berman <Julian@GrayVines.com>2022-08-29 12:23:07 +0300
commit8e43f784bea88ee1a7344036f90808b49dc26e53 (patch)
treefc752778798363dd30bd9582de935f94e1aeaf85 /docs/conf.py
parent9c7983748108f3c03a575eaffeb48333bbbc37c1 (diff)
downloadjsonschema-8e43f784bea88ee1a7344036f90808b49dc26e53.tar.gz
Experiment with autoapi for generating explicit API documentation.
Ref: #590
Diffstat (limited to 'docs/conf.py')
-rw-r--r--docs/conf.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/conf.py b/docs/conf.py
index d419918..b821453 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,8 +1,12 @@
from importlib import metadata
+from pathlib import Path
import os
import re
import sys
+ROOT = Path(__file__).parent.parent
+PACKAGE_SRC = ROOT / "jsonschema"
+
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -25,6 +29,8 @@ extensions = [
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
+
+ "autoapi.extension",
"sphinx_autodoc_typehints",
"sphinx_json_schema_spec",
"sphinxcontrib.spelling",
@@ -252,3 +258,27 @@ autosectionlabel_prefix_document = True
# -- Options for sphinxcontrib-spelling -----------------------------------
spelling_word_list_filename = "spelling-wordlist.txt"
+
+# -- Options for autoapi --------------------------------------------------
+
+suppress_warnings = [
+ "autoapi.python_import_resolution",
+ "autoapi.toc_reference",
+]
+autoapi_root = "api"
+autoapi_ignore = [
+ "*/_[a-z]*.py",
+ "*/__main__.py",
+ "*/benchmarks/*",
+ "*/cli.py",
+ "*/tests/*",
+]
+autoapi_options = [
+ "members",
+ "undoc-members",
+ "show-module-summary",
+ "imported-members",
+]
+
+autoapi_type = "python"
+autoapi_dirs = [PACKAGE_SRC]