@@ -163,13 +163,13 @@ def _process_single_mdx_file(file_info: tuple) -> dict:
163
163
164
164
Args:
165
165
file_info (tuple):
166
- Tuple containing file information (file_path, doc_folder, output_dir, page_info, version_tag_suffix,
167
- package_name).
166
+ Tuple containing file information (file_path, doc_folder, output_dir, page_info, version_tag_suffix).
168
167
169
168
Returns:
170
169
dict: Dictionary containing the processed results for this file (file, new_anchors, errors, source_files).
171
170
"""
172
- file_path , doc_folder , output_dir , page_info , version_tag_suffix , package_name = file_info
171
+ file_path , doc_folder , output_dir , page_info , version_tag_suffix = file_info
172
+ package_name = page_info ["package_name" ]
173
173
174
174
file_path = Path (file_path )
175
175
doc_folder = Path (doc_folder )
@@ -244,7 +244,7 @@ def _process_single_mdx_file(file_info: tuple) -> dict:
244
244
245
245
def build_mdx_files (package , doc_folder , output_dir , page_info , version_tag_suffix ):
246
246
"""
247
- Build the MDX files for a given package.
247
+ Build the MDX files for a given package. Uses multiprocessing to process files in parallel.
248
248
249
249
Args:
250
250
package (`types.ModuleType`): The package where to look for objects to document.
@@ -269,11 +269,7 @@ def build_mdx_files(package, doc_folder, output_dir, page_info, version_tag_suff
269
269
all_errors = []
270
270
271
271
# Prepare arguments for multiprocessing
272
- package_name = package .__name__ if package else None
273
- file_args = [
274
- (str (file ), str (doc_folder ), str (output_dir ), page_info , version_tag_suffix , package_name )
275
- for file in all_files
276
- ]
272
+ file_args = [(str (file ), str (doc_folder ), str (output_dir ), page_info , version_tag_suffix ) for file in all_files ]
277
273
278
274
# Use multiprocessing to process files in parallel
279
275
with Pool () as pool :
0 commit comments