|
13 | 13 | import os |
14 | 14 | import re |
15 | 15 | from pathlib import Path |
16 | | -from typing import Dict, List |
17 | 16 |
|
18 | 17 |
|
19 | 18 | class APIDocGenerator: |
@@ -51,7 +50,7 @@ def __init__(self, source_dir: str = "sqlstream", docs_dir: str = "docs/api/refe |
51 | 50 | "utils": "Utility functions and helpers.", |
52 | 51 | } |
53 | 52 |
|
54 | | - def discover_modules(self) -> Dict[str, List[str]]: |
| 53 | + def discover_modules(self) -> dict[str, list[str]]: |
55 | 54 | """Automatically discover all Python modules in the source directory""" |
56 | 55 | modules_by_category = {} |
57 | 56 |
|
@@ -87,7 +86,7 @@ def discover_modules(self) -> Dict[str, List[str]]: |
87 | 86 |
|
88 | 87 | return modules_by_category |
89 | 88 |
|
90 | | - def get_classes_and_functions(self, module_path: str) -> Dict[str, List[str]]: |
| 89 | + def get_classes_and_functions(self, module_path: str) -> dict[str, list[str]]: |
91 | 90 | """Extract classes and functions from a Python module""" |
92 | 91 | # Convert module path to file path |
93 | 92 | relative_path = module_path.replace("sqlstream.", "").replace(".", "/") |
@@ -131,7 +130,7 @@ def generate_mkdocstrings_block( |
131 | 130 | show_source: true |
132 | 131 | """ |
133 | 132 |
|
134 | | - def generate_category_doc(self, category_name: str, modules: List[str]) -> str: |
| 133 | + def generate_category_doc(self, category_name: str, modules: list[str]) -> str: |
135 | 134 | """Generate markdown file for a category""" |
136 | 135 | title = self.category_titles.get(category_name, f"{category_name.title()} Reference") |
137 | 136 | description = self.category_descriptions.get( |
@@ -160,7 +159,7 @@ def generate_category_doc(self, category_name: str, modules: List[str]) -> str: |
160 | 159 | return "\n".join(lines) |
161 | 160 |
|
162 | 161 | def update_mkdocs_nav( |
163 | | - self, modules_by_category: Dict[str, List[str]], mkdocs_file: str = "mkdocs.yml" |
| 162 | + self, modules_by_category: dict[str, list[str]], mkdocs_file: str = "mkdocs.yml" |
164 | 163 | ): |
165 | 164 | """Update mkdocs.yml navigation with generated API reference pages using text manipulation""" |
166 | 165 | mkdocs_path = Path(mkdocs_file) |
|
0 commit comments