From 79cb2ed9d121fe1295c09f01891bf15e45210712 Mon Sep 17 00:00:00 2001 From: georgedouzas Date: Fri, 10 Jan 2025 16:37:20 +0200 Subject: [PATCH] docs: Exclude GUI from API documentation --- docs/generate_api.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/generate_api.py b/docs/generate_api.py index fb76926..acff16a 100644 --- a/docs/generate_api.py +++ b/docs/generate_api.py @@ -7,9 +7,8 @@ import mkdocs_gen_files nav = mkdocs_gen_files.nav.Nav() -exclude_modules: list[str] = ['sportsbet.cli'] -paths = sorted(Path('src').rglob('*.py')) +paths = [path for path in sorted(Path('src').rglob('*.py')) if 'cli' not in str(path) and 'gui' not in str(path)] paths = [ path for path in paths @@ -29,10 +28,7 @@ full_doc_path = full_doc_path.with_name('index.md') ident = '.'.join(parts) - if ident not in exclude_modules: - nav[parts] = doc_path.as_posix() - - with mkdocs_gen_files.open(full_doc_path, 'w') as fd: - fd.write(f'::: {ident}') - - mkdocs_gen_files.set_edit_path(full_doc_path, Path('../') / path) + nav[parts] = doc_path.as_posix() + with mkdocs_gen_files.open(full_doc_path, 'w') as fd: + fd.write(f'::: {ident}') + mkdocs_gen_files.set_edit_path(full_doc_path, Path('../') / path)