diff --git a/docs/conf.py b/docs/conf.py index 5e8a29a3..36dd7e4f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,7 +15,7 @@ # -- General configuration --------------------------------------------------- -extensions = ["jupyter_sphinx", "sphinx_rtd_theme", "sphinx_design"] +extensions = ["jupyter_sphinx", "sphinx_rtd_theme", "sphinx_design", "autoapi.extension"] templates_path = ["_templates"] exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] @@ -59,3 +59,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 c72f393c..ada21354 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,12 +40,15 @@ 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", "sphinx-autoapi"] test = ["pytest", "pytest-playwright<0.6", "nbformat<5.10", "jupyterlab<4", "solara[pytest]"] doc = [ "sphinx<7", "jupyter-sphinx", "ipykernel", "pydata-sphinx-theme", + "sphinx-autoapi", "sphinx-design", "sphinx_rtd_theme", ]