Skip to content

Commit

Permalink
Don't document zarr.codec submodules (#2605)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstansby authored Jan 2, 2025
1 parent 2535503 commit f407a41
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import sys
from typing import Any

import sphinx
import sphinx.application

from importlib.metadata import version as get_version
Expand Down Expand Up @@ -60,6 +61,20 @@
autoapi_keep_files = True
autoapi_options = [ 'members', 'undoc-members', 'show-inheritance', 'show-module-summary', 'imported-members', ]

def skip_submodules(
app: sphinx.application.Sphinx,
what: str,
name: str,
obj: object,
skip: bool,
options: dict[str, Any]
) -> bool:
# Skip documenting zarr.codecs submodules
# codecs are documented in the main zarr.codecs namespace
if what == "module" and name.startswith("zarr.codecs."):
skip = True
return skip

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down Expand Up @@ -179,6 +194,7 @@

def setup(app: sphinx.application.Sphinx) -> None:
app.add_css_file("custom.css")
app.connect("autoapi-skip-member", skip_submodules)


# The name of an image file (relative to this directory) to use as a favicon of
Expand Down

0 comments on commit f407a41

Please sign in to comment.