From 90d6b1d39b4f2bdd53f36b52273e96f36fb6f59c Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 16 Feb 2024 10:05:03 +0900 Subject: [PATCH] Exclude pynwb retinotopy from sphinx apidoc (#1846) * Exclude pynwb retinotopy from sphinx * Update conf.py * Update conf.py * Update conf.py * Fix sphinx apidoc exclude --- docs/source/conf.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index c46d2edd5..8e3d42ab3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -209,6 +209,12 @@ def __call__(self, filename): # directories to ignore when looking for source files. exclude_patterns = ['_build', 'test.py'] +# List of patterns, relative to source directory, of modules to be +# excluded by apidoc when generating rst files. +apidoc_exclude = [ + "../../src/pynwb/retinotopy.py", +] + # The reST default role (used for this markup: `text`) to use for all documents. # default_role = None @@ -411,7 +417,8 @@ def run_apidoc(_): out_dir = os.path.dirname(__file__) src_dir = os.path.join(out_dir, '../../src') sys.path.append(src_dir) - apidoc_main(['-f', '-e', '--no-toc', '-o', out_dir, src_dir]) + apidoc_exclude_abs = [os.path.join(out_dir, f) for f in apidoc_exclude] + apidoc_main(['-f', '-e', '--no-toc', '-o', out_dir, src_dir, *apidoc_exclude_abs]) from abc import abstractproperty