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

docs: implement autoapi #269

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
33 changes: 32 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down