8000 Don't document zarr.codec submodules (#2605) · rtobar/zarr-python@f407a41 · GitHub
[go: up one dir, main page]

Skip to content

Commit f407a41

Browse files
authored
Don't document zarr.codec submodules (zarr-developers#2605)
1 parent 2535503 commit f407a41

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/conf.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import sys
1818
from typing import Any
1919

20+
import sphinx
2021
import sphinx.application
2122

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

64+
def skip_submodules(
65+
app: sphinx.application.Sphinx,
66+
what: str,
67+
name: str,
68+
obj: object,
69+
skip: bool,
70+
options: dict[str, Any]
71+
) -> bool:
72+
# Skip documenting zarr.codecs submodules
73+
# codecs are documented in the main zarr.codecs namespace
74+
if what == "module" and name.startswith("zarr.codecs."):
75+
skip = True
76+
return skip
77+
6378
# Add any paths that contain templates here, relative to this directory.
6479
templates_path = ["_templates"]
6580

@@ -179,6 +194,7 @@
179194

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

183199

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

0 commit comments

Comments
 (0)
0