diff --git a/docs/conf.py b/docs/conf.py index f3b80c00..78e12925 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,7 +14,7 @@ # -- General configuration --------------------------------------------------- -extensions = ["jupyter_sphinx", "sphinx_rtd_theme"] +extensions = ["jupyter_sphinx", "sphinx_rtd_theme", "autoapi.extension"] templates_path = ["_templates"] exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] @@ -55,3 +55,34 @@ "github_version": "master", "doc_path": "docs", } + +# -- Options for autosummary/autodoc output ------------------------------------ +autodoc_typehints = "description" +autoapi_dirs = ["../ipyvuetify"] +autoapi_member_order = "groupwise" +autoapi_options = [ + "members", + "undoc-members", + "show-inheritance", + "show-module-summary", + "imported-members", +] + + +def skip_submodules(app, what, name, obj, skip, options): + """Ignore the modules and packages taht are private + + Only necessary for those that are not using a leading underscore + """ + privates = [ + ("module", "ipyvuetify.Html"), + ("module", "ipyvuetify.VuetifyTemplate"), + ("package", "ipyvuetify.generated"), + ] + + # return `skip` when nothing is catch to keep skipping the private members + return any([what == t and name == m for t, m in privates]) or skip + + +def setup(sphinx): + sphinx.connect("autoapi-skip-member", skip_submodules) diff --git a/pyproject.toml b/pyproject.toml index 54b135ff..6c31f114 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ content-type = "text/markdown" [project.optional-dependencies] dev = ["nox", "pre-commit", "mypy"] test = ["pytest", "pytest-playwright", "jupyterlab<4", "solara[pytest]"] -doc = ["sphinx<7", "jupyter-sphinx", "ipykernel", "pydata-sphinx-theme"] +doc = ["sphinx<7", "jupyter-sphinx", "ipykernel", "pydata-sphinx-theme", "sphinx-autoapi"] [tool.setuptools] include-package-data = true